ruby on rails - Handle check box forms with an `:has_many :through` Record Association -
i using ruby on rails 3.0.7 , use check box fields in view files (that is, new , edit forms) :has_many :through record association. seen kind of things easily implemented using has_and_belongs_to_many record association, possible make work easly first mentioned association? if so, how that?
the link dogbert supplied way of doing manual. if decide use simple form functionality build in.
using example mentioned article do:
<%= simple_form_for(@user) |f| %> <%= f.association :groups, :as => :check_boxes %> <%= f.submit %> <% end %> this example of course simplified should work. luck!
Comments
Post a Comment