Skip to content

Instantly share code, notes, and snippets.

@czivko
Created November 23, 2011 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czivko/1387668 to your computer and use it in GitHub Desktop.
Save czivko/1387668 to your computer and use it in GitHub Desktop.
event packages
{
"utf8" =>"✓",
"authenticity_token" =>"L8ezPjizbUKbcgi6qHrYrXntBfTPPz1a8QSKqk+lvSk=",
"event" => {
"name" =>"one",
"start_time" =>"",
"end_time" =>"",
"venue_name" =>"",
"address" =>"",
"city" =>"",
"state" =>"",
"zip" =>"",
"event_packages_attributes" => {
"0" => {
"price" =>"33"
}
},
"private" =>"0"
},
"commit" =>"Create Event",
"action" =>"create",
"controller" =>"vendor/events"
}
#starting at line 68
.price.section
=f.fields_for :event_packages do |p|
%section
%label
Will you be charging for this event?
.p
%input.ioscheckbox.charging{:type => "checkbox"}/
.pricesection.subsection
%section
%label General Admission Price
.p
$
=p.text_field:price
%section
%label
Early Bird Price?
.p
%input.ioscheckbox.earlybird{:type => "checkbox"}/
.earlysection.subsection
%section
%label Early Bird Price
.p
$
%input.small{:type => "text"}/
%section
%label When will this promotion end
.p
%input.medium.hasDatepicker{:type => "text"}/
@czivko
Copy link
Author

czivko commented Nov 23, 2011

see how event_packages needs to be nested inside of even
the generated html needs to look like this

so rails serializes everything correctly to the params
also i have a validation in event_package.rb model that needs to be removed, kill line 4 validates :event_id, :presence => true other wise it won't save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment