Hello,

I have a form that should be a POST method, but Rails insist to put a
hidden field "_method" that has the value "put" does anyone knows why?

Thanks,

David Sousa

Controller: -------------------------------
  def new
    @user = @current_user
  end
-------------------------------------------

View: -------------------------------------
<% semantic_form_for @user, :url => profile_reset_password_url do |form|
-%>
  <% form.inputs -%>
    <%= form.input :password -%>
    <%= form.input :new_password -%>
    <%= form.input :new_password_confirmation -%>
  <% end -%>
  <%= form.buttons %>

<% end -%>
-------------------------------------------

Routes: -----------------------------------
  map.namespace :profile do |profile|
    profile.resource :reset_password, :only => [:new, :create]
  end
-------------------------------------------

Output: -----------------------------------
<form method="post" id="edit_user_2" class="formtastic user"
action="http://localhost:3000/profile/reset_password";><div
style="margin: 0pt; padding: 0pt; display: inline;">

<input type="hidden" value="put" name="_method">
<input type="hidden"
value="YttRSHr2SzCqC4FbQccH6QgcWVKRkf1IBIIXnQhuaFw="
name="authenticity_token"></div>

<fieldset class="inputs"><legend><span>Informações</span></legend><ol>
<li id="user_password_input" class="password required"><label
for="user_password">Password<abbr
title="required">*</abbr></label><input type="password" size="50"
name="user[password]" id="user_password"></li>    <li
id="user_new_password_input" class="password required"><label
for="user_new_password">New password<abbr
title="required">*</abbr></label><input type="password" size="50"
name="user[new_password]" id="user_new_password"></li>    <li
id="user_new_password_confirmation_input" class="password
required"><label for="user_new_password_confirmation">New password
confirmation<abbr title="required">*</abbr></label><input
type="password" size="50" name="user[new_password_confirmation]"
id="user_new_password_confirmation"></li>  </ol></fieldset>  <fieldset
class="buttons"><ol><li class="commit"><input type="submit" value="Save
User" name="commit" id="user_submit"></li></ol></fieldset>

</form>
-------------------------------------------
-- 
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.

Reply via email to