Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. = simple_form_for @user do |f|
  2. = f.input :name
  3. = f.input :email, label: "E-mail"
  4. = f.association :subscriptions, collection: @user.subscriptions,
  5. as: :check_boxes, value_method: :active, checked: lambda { |subscription| subscription.active? }
  6.  
  7. = f.button :submit, "Save"
  8.  
  9. = simple_form_for @user do |f|
  10. = f.input :name
  11. = f.input :email, label: "E-mail"
  12. - f.simple_fields_for :publications do |subscription|
  13. # Here you have all simple_form methods available
  14. = subscription.check_box :active
  15.  
  16. = f.button :submit, "Save"
  17.  
  18. attr_accessible :subscriptions_attributes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement