Forum: Ruby on Rails Issues With form_remote_tag

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
corey.mosher (Guest)
on 2005-11-12 12:50
(Received via mailing list)
I'm trying to write my first rails application and I'm running into a
problem that I just can't seem to find the answer to.  I'm trying to
make each row on my list page editable.  So there's a form for each
row.  When I submit the form, my form values are not getting added to
the @params list.  This is what I have for my list.rhtml page (I
appologize for the formatting):

		<%= javascript_include_tag  :defaults %>


		<div id="category_new">
			<%= form_remote_tag :url => { :action => "create_ajax" },
  				:update=> "categories-list",
  				:position=> "bottom",
  				:effects => 'highlight',
  				:loading => "category.reset()",
  				:html=> { :id=>'category-form', :name=>'category' } %>

  			<label for="category_name">Name</label><br />
  			<%= text_field 'category', 'name'  %>

			<input type="submit" value="Create" />

			<%= end_form_tag %>

		<table id="categories-list" class="categories-list">
		<% for category in @categories %>
  		<%= render_partial( 'category', category ) %>
		<% end %>

This is what I have for _category.rhtml:

<%= form_remote_tag :url => { :action => "update_ajax", :id => },
				:update=> "categories-list",
  				:position=> "bottom",
  				:effects => 'highlight',
  				:html => { :id=>'category-form-#{',

:name=>'division_form_#{' }%>
<tr id="category-<%= %>">
    <%= text_field("category_#{}", "name", "value" =>, "class" => "updateCatOn") %>
    <%= hidden_field("category_#{}", "id", "value" => %>
  <td><%= link_to 'Show', :action => 'show', :id => %></td>
  <td><%= submit_tag("Update") %></td>
  <td><%= link_to 'Destroy', :action => 'destroy', :id =>
<%= end_form_tag %>
<% if controller.action_name == 'create_ajax' %>
   new Effect.Highlight('category-<%= %>');
<% end %>
<% if controller.action_name == 'update_ajax' %>
   new Effect.Highlight('category-<%= %>');
<% end %>

When I look at the log file I see that the following is what I have
for parameters:

Parameters: {"action"=>"update_ajax", "id"=>"1",

Any help would be appreciated.


Corey Mosher
This topic is locked and can not be replied to.