Hi Shilo,

On Tue, 2009-02-03 at 12:51 +0100, Shilo Ayalon wrote:
> I'm having a similar problem with button_to and button_to_remote - I'm
> trying to set the action to submit through:
> 
> <%= button_to 'update', { :action => "update", :id => product.id } %>
> 
> Regardless, the button's action points to /products/:id as the html
> shows:
> 
> <form class="button-to" action="/products/1" method="post">
>   <div><input type="submit" value="ok"/>
>     <input type="hidden"
> value="d8188afe727a223642b0d51579c9a2333f1e5ba5"
> name="authenticity_token"/>
>   </div>
> </form>
> 
> Why?..

That's a RESTful url.  A POST to a resource with an ID is the RESTful
equivalent of an Update in CRUD.  Google 'rails restful routes' for
more.

HTH,
Bill


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to