Views <code> <% form_for :user, @user, :url => { :action => "update" }, :method => :put do |f| %> ... <% end %> </code> Outputs <code> <form action="/users/1" method="post"> ... </code> It sends post instead of put. I don''t see any hackish hidden put stuff in the form either. -- Posted via http://www.ruby-forum.com/.
On 6/29/06, Josh Peek <josh@joshpeek.com> wrote:> Views > <code> > <% form_for :user, @user, :url => { :action => "update" }, :method => > :put do |f| %> > ... > <% end %> > </code> > > Outputs > <code> > <form action="/users/1" method="post"> > ... > </code> > > It sends post instead of put. I don''t see any hackish hidden put stuff > in the form either. >Put this in your form somewhere: <%= hidden_field_tag ''_method'', ''put'' %> That''s the Rails workaround for the fact that browsers can''t send PUT requests.
Wilson Bilkovich wrote:> That''s the Rails workaround for the fact that browsers can''t send PUT > requests.Thanks. I thought that was supposed to be automatically inserted. -- Posted via http://www.ruby-forum.com/.