Hello, I can''t figure out how to do this: I have a Post Model and it :has_and_belongs_to_many :tags. When I edit a Post, I want to create checkboxes or a select field (with multiple select choices), so I can add tags to a Post directly from its form. Is there a way to achieve this nicely or do I have to create something like just check_box_tags whithin a loop and process those back in the controller? Tomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, Feb 1, 2009 at 6:25 AM, Tomas Markauskas <info-OHPFaY4Ui06sTnJN9+BGXg@public.gmane.org> wrote:> > Hello, > > I can''t figure out how to do this: > > I have a Post Model and it :has_and_belongs_to_many :tags. When I edit > a Post, I want to create checkboxes or a select field (with multiple > select choices), so I can add tags to a Post directly from its form. > Is there a way to achieve this nicely or do I have to create something > like just check_box_tags whithin a loop and process those back in the > controller? > > TomasI wanted to do something very similar and I modeled my application after this: http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm --wpd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve already implemented it in a very similar way, but that looks a bit nicer. Thanks! Tomas On Feb 2, 2:57 pm, Patrick Doyle <wpds...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sun, Feb 1, 2009 at 6:25 AM, Tomas Markauskas <i...-OHPFaY4Ui06sTnJN9+BGXg@public.gmane.org> wrote: > > > Hello, > > > I can''t figure out how to do this: > > > I have a Post Model and it :has_and_belongs_to_many :tags. When I edit > > a Post, I want to create checkboxes or a select field (with multiple > > select choices), so I can add tags to a Post directly from its form. > > Is there a way to achieve this nicely or do I have to create something > > like just check_box_tags whithin a loop and process those back in the > > controller? > > > Tomas > > I wanted to do something very similar and I modeled my application after > this: > > http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-u... > > --wpd--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---