Note that there are some explanatory texts on larger screens.

plurals
  1. PONo route matches [POST] "/users/1/edit"
    text
    copied!<p>I get this error when I try to submit a form to edit user details. I'm using Rails 3.2.7. Here's my controller</p> <pre><code>class UsersController &lt; ApplicationController def index @users = User.all respond_to do |format| format.html # index.html.erb format.json { render json: @users } end end def show @user = User.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @user } end end def new @user = User.new end def edit @user = User.find(params[:id]) end def create @user = User.new(params[:user]) if @user.save sign_in @user flash[:success] = "Welcome to the app!" redirect_to welcome_path else render 'new' end end def update @user = User.find(params[:id]) if @user.update_attributes(params[:user]) sign_in @user flash[:success] = "Profile updated" redirect_to welcome_path else render 'edit' end end def destroy @user = User.find(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to users_url } format.json { head :no_content } end end end </code></pre> <p>And the form:</p> <pre><code>&lt;%= form_for(@user) do |f| %&gt; &lt;% if @user.errors.any? %&gt; &lt;div id="error_explanation"&gt; &lt;p&gt;&lt;%= pluralize(@user.errors.count, "error") %&gt; prohibited this user from being saved:&lt;/p&gt; &lt;ul&gt; &lt;% @user.errors.full_messages.each do |msg| %&gt; &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt; &lt;% end %&gt; &lt;/ul&gt; &lt;/div&gt; &lt;% end %&gt; &lt;div class="box"&gt; &lt;%= f.label :email %&gt; &lt;%= f.text_field :email, class:"input_text" %&gt; &lt;br&gt; &lt;%= f.label :"edit password" %&gt; &lt;%= f.password_field :password, class:"input_text" %&gt; &lt;br&gt; &lt;label&gt; &lt;br&gt; &lt;%= f.submit "Save", class: "button", name: "button" %&gt; &lt;/label&gt; &lt;/div&gt; &lt;% end %&gt; </code></pre> <p>Rake routes outputs:</p> <pre><code> users GET /users(.:format) users#index POST /users(.:format) users#create new_user GET /users/new(.:format) users#new edit_user GET /users/:id/edit(.:format) users#edit user GET /users/:id(.:format) users#show PUT /users/:id(.:format) users#update DELETE /users/:id(.:format) users#destroy </code></pre> <p>Let me know if there is something else I should be posting... thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload