Re: [Rails] How to create Categories in Rails
On Jul 20, 2013, at 12:56 AM, Giannakis P. <lists@ruby-forum.com> wrote:
> Hey Ruby on Rails Community
>
> i'm trying to Add Categories to my Rails app, but don't quite know how
> to do this.
>
> I have many Pins(Images) and want the user to be able to assign a
> category on those Pins. ASSIGN not create, edit, or delete a Category,
> just selecting one for their Pin. Meaning that, When a user uploads a
> pin, he can choose from a dropdown list a Category.
>
> Then, another user can choose from the Menu a Category, and ONLY the
> Pins in this Category will be listed.
>
> How do i do this? Where to start ?
>
> Thank you
It sounds as though you are going to limit them to one category per pin.
Simply using that, a given pin will belong to a category, and a category will have many pins. This should tell you the relationship to use. Read the rails guide on relationships for how to set this up.
Since you are not allowing the user to define categories, you will need, as an admin or as part of your app configuration, to fill in the categories you want your users to be able to select from.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8937B012-B38B-4F00-A3BF-E1C5359C15AB%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home