Hello,
I'm struggling my brain with this ajax issue ...
Basically I have a form for creating records, and I want to submit it
using Ajax.
On previous versions of RoR (2.0.2) it was working, but the same methods
doesn't work on 2.2.2, and I started to make changes and changes and
read forums and the api, but no way ...
<% form_remote_for (:expedient, :url => {:action => 'create_ajax'},
:update =>'div_listd') do |f| %>
<table class="edit">
<tr>
<td class="label" width="100px">Referencia</td>
<td class="data"><%= f.text_field :reference %></td>
<td><%= submit_tag "Añadir" %></td>
</tr>
</table>
<% end %>
In the development.log I only see the token param:
Parameters:
{"authenticity_token"=>"c5fb066b9a3370e15f94154cc2140759d40f079c"}
the html source code is this:
<form action="/expedients/create_ajax" method="post" onsubmit="new
Ajax.Updater('div_listd', '/expedients/create_ajax', {asynchronous:true,
evalScripts:true, parameters:Form.serialize(this)}); return false;"><div
style="margin:0;padding:0"><input name="authenticity_token"
type="hidden" value="c5fb066b9a3370e15f94154cc2140759d40f079c" /></div>
<table class="edit">
<tr>
<td class="label" width="100px">Referencia</td>
<td class="data"><input id="expedient_reference"
name="expedient[reference]" size="30" type="text" /></td>
<td><input name="commit" type="submit" value="Añadir" /></td>
</tr>
</table>
I see that the method is post, I think it should be 'PUT' to pass the
variables in the params ... or I'm wrong in this assumption ?
I tried to add the :method => :put but no way ..... sure I put it in the
wrong place :-)
thanks again!
r.
--
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 [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
-~----------~----~----~----~------~----~------~--~---