<%= submit_to_remote(:category, :url => params[:id].blank? ? {:action => 'create'} : {:action => "update", :id => @category}) do %>
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td><%= text_field(:category, :name, :size => 20) %></td>
<td><%= submit_tag(params[:id].blank? ? "New": "Edit") %></td>
</tr>
</table>
<% end %>
I want to create new record using Ajax. I got error undefined method submit_to_remote I declared prototype file in layout. waiting for ans.......