Hi all:
I have a form and I want to use the same code for "new" and "edit"
methods rendering the view code in a partial.

This view code is working for the "new" method but do not for  the
"edit", cause of the name of the form object.

Code for the New View
<%= render :partial => "order_form" %>

<%= link_to 'Back', order_path %>

Code for the Edit View (same as new...)
<%= render :partial => "order_form" %>

<%= link_to 'Back', order_path %>

Code for the partial View "_order_form"

<% form_for(@order) do |f| %>

 <%= observe_field 'order_field1', :url => {:action =>
'calculate'}, :with => "Form.serialize('new_order')" %>

<% end %>

The observe field only works for the "new" because the "hardcoding"
parameter name of the form.
For new object the name of the form is "new_order", for editing is
"edit_order_19" (19 is an ID for the "order" object)
The name of the form is depending of the object the view is editing
and I need the name for the Observe_field work properly in all
records.
How can I pass the name of the form as a variable to the controller ?

Thanks
FF
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to