27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This chapter covers<br />

� Tagging specific records for easier searching<br />

� Restricting user access to tagging functionality<br />

� Searching for specific tags or specific states<br />

of a ticket<br />

286<br />

Tagging<br />

In chapter 10, you saw how to give your tickets states (New, Open, and Closed) so<br />

that their progress can be indicated.<br />

In this chapter, you’ll see how to give your tickets tags. Tags are useful for grouping<br />

similar tickets together into things such as iterations 1 or similar feature sets. If<br />

you didn’t have tags, you could crudely group tickets together by setting a ticket’s<br />

title to something such as “Tag - [name].” This method, however, is messy and difficult<br />

to sort through. Having a group of tickets with the same tag will make them<br />

much, much easier to find.<br />

To manage tags, you’ll set up a Tag model, which will have a<br />

has_and_belongs_to_many association to the Ticket model. You’ll set up a join<br />

table for this association, which is a table that contains foreign key fields for each<br />

1 For example, by using a process such as Agile, feature sets, or any other method of grouping.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!