I have an Event Model with a parent Place association
class Event < ActiveRecord::Base
belongs_to :place
accepts_nested_attributes_for :place
attr_accessible :place_attributes
In a new event registration form, the user should have the choice to :
- select from an existing Place
- enter a new Place in a nested form
= simple_form_for @event
= f.association :place, :collection => Place.all(:order =>
'label'), :prompt => "Choose an Place", :label => false
..
= f.simple_fields_for :place do |pf|
#geolocation.form-inputs
= pf.simple_fields_for :geolocation do |g|
= render "backoffice/places/
geolocation_fields", :f => g
should I manage that with a jQuery script ?
- when user select a place , it will clear the nested place form
- when user enter data in the nested place form, it will reinitiate
the place select
how can I manage the duplicated attribute param ? ( should the js
script add/remove the corresponding html elements ?)
I'm a little bit lost in translation.....
on 2012-10-09 16:43
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.