Issues With form_remote_tag


#1

Hi,
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):

Categories <%= javascript_include_tag :defaults %>
	<h1>Categories</h1>

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

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

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

		<%= end_form_tag %>
		<!--[eoform:category]-->
	</div>

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

This is what I have for _category.rhtml:

<%= form_remote_tag :url => { :action => “update_ajax”, :id =>
category.id },
:update=> “categories-list”,
:position=> “bottom”,
:effects => ‘highlight’,
:html => { :id=>‘category-form-#{category.id)’,

:name=>‘division_form_#{category.id)’ }%>

<%= text_field("category_#{category.id}", "name", "value" => category.name, "class" => "updateCatOn") %> <%= hidden_field("category_#{category.id}", "id", "value" => category.id) %> <%= link_to 'Show', :action => 'show', :id => category.id %> <%= submit_tag("Update") %> <%= link_to 'Destroy', :action => 'destroy', :id => category.id %> <%= end_form_tag %> <% if controller.action_name == 'create_ajax' %> <% end %> <% if controller.action_name == 'update_ajax' %> <% 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”,
“controller”=>“category”}

Any help would be appreciated.

Thanks


Corey Mosher