hyuan wrote:
> Try this:
>
> <% form_for :user, :url => user_path(current_user), :html => {:method
> => :put} do |f| -%>
>
> Note that the put method is not officially supported, so when the HTML
> is directed as above, a hidden variable _method is introduced which
> the Rails router than interprets as a PUT eventhough technically the
> form is being submitted as a POST.
>
> HTH,
>
> Han Yuan
Thanks hyuan , this does works.
I was routes
map.resources "parties" , :controller => "political_parties"
so there is no way i can use
form_for(@political_party) do |f|
as it will create wrong pathname.
so i did this
<% form_for :political_party, :url => party_path(@political_party) ,
:html => {:method => :put } do |f| %>
--
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
-~----------~----~----~----~------~----~------~--~---