title: has one route error message "No route matches [POST] "/users/create""
body: <p>The error occured after submitting "Create" account, no matter I entered password or not, the error message is below:</p>
  
  <pre><code>No route matches [POST] "/users/create"
  </code></pre>
  
  <p>I built the page of registration, this is my <code>new.html.erb</code> in <code>users</code> file</p>
  
  <pre><code>&lt;div class="center hero-unit"&gt;
    &lt;% @page_title = "Sign up" %&gt;
      &lt;h1&gt;Sign Up&lt;/h1&gt;
      &lt;%= form_for(:user, :url =&gt; {:controller =&gt; 'users', :action =&gt; 'create'}) do |f| %&gt;
        &lt;p&gt; First name:&lt;/br&gt; &lt;%= f.text_field :first %&gt; &lt;/p&gt;
        &lt;p&gt; Last name:&lt;/br&gt; &lt;%= f.text_field :last %&gt; &lt;/p&gt;
        &lt;p&gt; Email:&lt;/br&gt; &lt;%= f.text_field :email %&gt; &lt;/p&gt;
        &lt;p&gt; Password:&lt;/br&gt; &lt;%= f.password_field :password %&gt;&lt;/p&gt;
        &lt;p&gt; Password Confirmation:&lt;/br&gt; &lt;%= f.password_field :password_confirmation %&gt; &lt;/p&gt;
        &lt;%= f.submit :Create, class:"btn btn-large btn-primary" %&gt;
        &lt;%= link_to "Cancel", root_path, class:"btn btn-large btn-primary" %&gt;
      &lt;% end %&gt;
      &lt;% if @user.errors.any? %&gt;
        &lt;ul class="Signup_Errors"&gt;
        &lt;% for message_error in @user.errors.full_messages %&gt;
          &lt;li&gt;* &lt;%= message_error %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The <code>route.rb</code> is:</p>
  
  <pre><code>Rails.application.routes.draw do
    get 'sessions/login'
    get 'sessions/main'
    get 'sessions/profile'
    get 'sessions/setting'
    get 'users/new'
    get 'home/index'
    root 'home#index'
    match '/about', to: 'home#about', via: 'get'
    match '/signup', to: 'users#new', via: 'get'
    match ':controller(/:action(/:id))(.:format)', via: 'get'
    match '/login', to: 'sessions#login', via: 'get'
    match '/logout', to: 'sessions#logout', via: 'get'
    match '/main', to: 'sessions#main', via: 'get'
    match '/profile', to: 'sessions#profile', via: 'get'
    match '/setting', to: 'sessions#setting', via: 'get'
  end
  </code></pre>
  
  <p>And the <code>users_controller.rb</code> is:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
    before_filter :save_login_state, :only =&gt; [:new, :create]
  
    def new
      @user = User.new
    end
  
    def create
      @user = User.new(user_params)
      if @user.save
        flash[:notice] = 'You signed up succefully!'
        flash[:color] = 'valid'
      else
        flash[:notice] = 'Form is invalid.'
        flash[:color] = 'invalid'
        render 'new'
      end
    end
    private
    def user_params
      params.require(:user).permit(:email, :password, :password_confirmation)
    end
  
  end
  </code></pre>
  
  <p>The <code>user.rb</code> in models is:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    #attr_accessible :email, :password, :password_confirmation
  
    attr_accessor :password
    EMAIL_REGEX = /\b[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}\z/
    validates :username, :presence =&gt; true, :uniqueness =&gt; true, :length =&gt; { :in =&gt; 3..20 }
    validates :email, :presence =&gt; true, :uniqueness =&gt; true, :format =&gt; EMAIL_REGEX
    validates :password, :confirmation =&gt; true #password_confirmation attr
    validates_length_of :password, :in =&gt; 6..20, :on =&gt; :create
  
    before_save :encrypt_password
    after_save :clear_password
  
    #attr_accessible :email, :password, :password_confirmation
  
    def encrypt_password
      if password.present?
        self.salt = BCrypt::Engine.generate_salt
        self.encrypted_password= BCrypt::Engine.hash_secret(password, salt)
      end
    end
    def clear_password
      self.password = nil
    end
  
  
    def self.authenticate(email="", login_password="")
      if EMAIL_REGEX.match(email)
        user = User.find_by_email(email)
      end
  
      if user &amp;&amp; user.match_password(login_password)
        return user
      else
        return false
      end
    end
    def match_password(login_password="")
      encrypted_password == BCrypt::Engine.hash_secret(login_password, salt)
    end
  
    #attr_accessible :email, :password, :password_confirmation
  end
  </code></pre>
  
  <p>I also created a <code>password_hashing.rb</code> in models:</p>
  
  <pre><code>require 'digest/sha1'
  encrypted_password= Digest::SHA1.hexdigest(password)
  </code></pre>
  
  <p>and a <code>password_hasing_with_salt.rb</code></p>
  
  <pre><code>salt= Digest::SHA1.hexdigest("# We add {email} as unique value and #{Time.now} as random value")
  encrypted_password= Digest::SHA1.hexdigest("Adding #{salt} to {password}")
  </code></pre>
  
  <p>In my <code>migrate</code>, the thing is:</p>
  
  <pre><code>class CreateUsers &lt; ActiveRecord::Migration
    def change
      create_table :users do |t|
        t.string :first
        t.string :last
        t.string :email
        t.string :encrypted_password
        t.string :salt
  
        t.timestamps
      end
    end
  end
  </code></pre>
  
  <p>Also, the error message includes:</p>
  
  <pre><code>Routes
  
  Routes match in priority from top to bottom
  
  Helper  HTTP Verb   Path    Controller#Action
  Path / Url          
  sessions_login_path      GET     /sessions/login(.:format)   sessions#login
  sessions_main_path       GET     /sessions/main(.:format)    sessions#main
  sessions_profile_path    GET     /sessions/profile(.:format)     sessions#profile
  sessions_setting_path    GET     /sessions/setting(.:format)     sessions#setting
  users_new_path           GET     /users/new(.:format)    users#new
  home_index_path          GET     /home/index(.:format)   home#index
  root_path                GET     /   home#index
  courses_path             GET     /courses(.:format)  courses#index
                           POST    /courses(.:format)  courses#create
  new_course_path          GET     /courses/new(.:format)  courses#new
  edit_course_path         GET     /courses/:id/edit(.:format)     courses#edit
  course_path              GET     /courses/:id(.:format)  courses#show
                           PATCH   /courses/:id(.:format)  courses#update
                           PUT     /courses/:id(.:format)  courses#update
                           DELETE  /courses/:id(.:format)  courses#destroy
  about_path               GET     /about(.:format)    home#about
  signup_path              GET     /signup(.:format)   users#new
                           GET     /:controller(/:action(/:id))(.:format)  :controller#:action
  login_path               GET     /login(.:format)    sessions#login
  logout_path              GET     /logout(.:format)   sessions#logout
  main_path                GET     /main(.:format)     sessions#main
  profile_path             GET     /profile(.:format)  sessions#profile
  setting_path             GET     /setting(.:format)  sessions#setting
  </code></pre>
  
  <p>How can I solve this problem please?
  Thank you for your time!</p>