Forum: Ruby on Rails button_to Problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
006a4831843b48f6102d5d3cf92ae283?d=identicon&s=25 Shilo Ayalon (gte351s)
on 2009-02-03 12:51
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?..
91a72b0ad3e43e3ef3a31816667ec694?d=identicon&s=25 bill walton (Guest)
on 2009-02-03 18:07
(Received via mailing list)
Hi Shilo,

On Tue, 2009-02-03 at 12:51 +0100, Shilo Ayalon wrote:
>     <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
This topic is locked and can not be replied to.