Created
January 27, 2016 22:22
-
-
Save trev/ffff644f22f0cfdbcb9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= simple_form_for @form, wrapper: :booking do |f| | |
.simple-group | |
%h3.small-title Your Personal Information | |
= f.simple_fields_for :line_items do |li| | |
= li.simple_fields_for :passengers do |pax| | |
.row | |
.col-md-12 | |
%h4= "Trip: #{Product.find(li.object.product_id).title}" | |
%h5= "Tell us about dude ##{pax.index + 1}" | |
= pax.input :first_name, placeholder: 'Big' | |
= pax.input :last_name, placeholder: 'Lebowski' | |
= pax.input :email, placeholder: '[email protected]' | |
= pax.input :phone_number, placeholder: '+61 410 394 323' | |
= pax.input :dob, label: "Date of birth", placeholder: 'dd/mm/yyyy' | |
= f.button :submit |
apotonick
commented
Jan 27, 2016
@apotonick doing something like:
class YourForm < Reform::Form
def product
Product.find(self.product_id)
end
end
Will result in getting the following error:
*** ArgumentError Exception: A copy of YourForm has been removed from the module tree but is still active!
Works fine if you do ::Product.find(self.product_id)
to jump out of the local scope.
Comments?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment