On Thu, May 14, 2009 at 6:23 AM, Fernando Perez wrote:
>> put :update, :item => 1 etc.
>>
> I tried that but didn't work. I managed to get it working by simply
> doing:
>
> post :update, {:id => 'dummy', :item => {'1' => ...}}
>
> For some reason, I previously tried with :id => 'update' but Rails
> put :update, :item => 1 etc.
>
I tried that but didn't work. I managed to get it working by simply
doing:
post :update, {:id => 'dummy', :item => {'1' => ...}}
For some reason, I previously tried with :id => 'update' but Rails
didn't like it.
--
Posted via http://www.ruby-forum.com/.
_
On May 13, 2009, at 1:42 PM, Fernando Perez wrote:
Hi,
I use restful routes. In one of my views I have a form that looks
like:
<%- form_tag '/items/update', :method => :put do -%>
...
<%= submit_tag "Recalculate" %>
<%- end -%>
I know I cheated a bit, as I should be submitting to /items
Hi,
I use restful routes. In one of my views I have a form that looks like:
<%- form_tag '/items/update', :method => :put do -%>
...
<%= submit_tag "Recalculate" %>
<%- end -%>
I know I cheated a bit, as I should be submitting to /items/1 instead.
Anyway, now how can I trigger the update act