Rails 3.1.3
I have a model, "Plan" that has columns :flight_name_id(integer).
From the user point of view, searching flights from the places of
departure and destination is in fact logically reasonable. So, my forms
ask users to input places first, then Ajax updates the available flight
plans in the select forms that follow. (Ajax functionality works well,
though)
But "Plan" model only needs flight_name to be stored, so both
departure
and destination forms should not be model oriented.
The following code gives an error,
undefined method `departure_id''
<%= semantic_form_for @plan do |f| %>
<%= f.inputs do %>
<%= f.input :departure_id, :as => :select,
:collection => City.find(:all, :order=>:name).collect{ |c|
[c.name,c.id]},
:required=>true %>
<div id="destinationCity">
<%= render :partial => ''destination'' %>
</div>
<div id="flight_name">
<%= render :partial => ''flight_name'' %>
</div>
...
Certainly, a similar error will appear for destination as well even if
this error is resolved.
Somehow, I need a set of nested forms that is a mixture of form_for and
form_tag (?) if I am correct.
My question is :
How can I make a collection of select forms including both form_tag
and form_for ?
Thanks
soichi
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.