title: Get Request is passed instead of post request from new.html
body: <p>I am trying out for basic login and registration in ruby on rails, 
  <strong>ISSUE: When I click register button from new.html I am getting GET request but I can see method="post" in page source of that html</strong> 
  I have posted my code below
  new.html.erb</p>
  
  <pre><code>    &lt;form&gt;
  &lt;%= form_for(@user) do |f| %&gt;
  &lt;%= f.label :user_name %&gt;
  &lt;%= f.text_field :user_name %&gt;&lt;/br&gt;
  &lt;%= f.label :email_id %&gt;
  &lt;%= f.text_field :email_id %&gt;&lt;/br&gt;
  &lt;%= f.label :password %&gt;
  &lt;%= f.password_field :password %&gt;&lt;/br&gt;
  &lt;%= f.label :college %&gt;
  &lt;%= f.text_field :college %&gt;&lt;/br&gt;
  &lt;%= f.label :major %&gt;
  &lt;%= f.text_field :major %&gt;&lt;/br&gt;
  &lt;%= f.label :current_job %&gt;
  &lt;%= f.text_field :current_job %&gt;&lt;/br&gt;
  &lt;%= f.submit("Create Account",class: "btn btn-primary") %&gt;
  &lt;% end %&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My index.html.erb code which is loaded while application starts</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;div class="row"&gt;
  
  &lt;div class="login"&gt;
  
  &lt;%= form_tag("/user/login",:method =&gt; :post) do %&gt;
  &lt;%= label_tag(:EmailId) %&gt;
  &lt;%= text_field_tag(:email, params[:email]) %&gt;&lt;/br&gt;
  &lt;%= label_tag(:password) %&gt;
  &lt;%= password_field_tag(:password, params[:password]) %&gt;&lt;/br&gt;
  &lt;%= submit_tag("Log In",class: "btn btn-primary") %&gt;
  &lt;%= submit_tag("Register",class: "btn btn-primary") %&gt;
  
  &lt;% end %&gt;
  &lt;/div&gt;
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My controller code</p>
  
  <pre><code>class UsersController &lt; ApplicationController
    def index
      @user = User.all
    end
  
  
  
    def login
      print "In Sign in controller"
      @user = User.new
      if params[:commit] == 'Register'
        print "inside Register class"
        redirect_to '/users/new'
      else
      @user = User.find(params[:email_id])
      if @user and user.authenticate(params[:password])
          sessions[:userId] = @user.user_id
      end
      end
      end
  
  
      def new
      puts "****Inside New Method******"
      @user = User.new
    end
  
    def create
     puts "****Inside create Method******"
    end
   private 
   def user_params
   end
  
  end
  </code></pre>
  
  <p>My Route code</p>
  
  <pre><code>Rails.application.routes.draw do
    root 'users#index'
     resources :users
     post '/users/login' =&gt; 'users#login'
  </code></pre>
  
  <p>As per my understanding post request should hit create method, but get /users method is hitting. Please help me out regarding this</p>