Hi,
being relativly new to RoR, I''m having a problem which I found
described
in this forum and somewhere else - but with no solution. I know, that it
may be bad to mix table and form tags, but the first solution of an in
place editing within a table looked nice:
Version using form_for:
<tr>
<%form_for :time_record, :url => { :action =>
"add_time_record" } do
|f| %>
<% f.date_select(:day, :disabled => true, :order => [:day, :month])
%>
<td><%= f.date_select(:day, :order => [:day, :month])
%></td>
<td><%= f.collection_select(:user_id, @users, :id, :login_name)
%></td>
<td><%= f.collection_select(:project_id, @projects, :id, :name)
%></td>
<td><%= f.text_field :quantity, :size => 4 %></td>
<td><%= f.text_field :description, :size => 50 %></td>
<td><%= submit_tag "Zeit Erfassen", :class =>
"submit" %></td>
<% end %>
</tr>
Works fine.
Iterating in small steps to AJAX, the next iteration was:
<tr>
<%form_remote_for :time_record, :url => { :action =>
"add_time_record"
} do |f| %>
<% f.date_select(:day, :disabled => true, :order => [:day, :month])
%>
<td><%= f.date_select(:day, :order => [:day, :month])
%></td>
<td><%= f.collection_select(:user_id, @users, :id, :login_name)
%></td>
<td><%= f.collection_select(:project_id, @projects, :id, :name)
%></td>
<td><%= f.text_field :quantity, :size => 4 %></td>
<td><%= f.text_field :description, :size => 50 %></td>
<td><%= submit_tag "Zeit Erfassen" %></td>
<% end %>
</tr>
Which did not work. Changing the whole thing to
<tr class="list-line-even">
<td>
<%form_remote_for :time_record, :url => { :action =>
"add_time_record" } do |f| %>
<%= f.date_select(:day, :order => [:day, :month]) %>
<%= f.collection_select(:user_id, @users, :id, :login_name) %>
<%= f.collection_select(:project_id, @projects, :id, :name) %>
<%= f.text_field :quantity, :size => 4 %>
<%= f.text_field :description, :size => 50 %>
<%= submit_tag "Zeit Erfassen" %>
<% end %>
</td>
</tr>
works fine again...
Which means mixing of table and form tags destroys the parameter
information.
In my opinion, form_for and form_remote_for should behave the same way.
Hopefully someone has a solution to this problem ?
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---