Shivakumar P
Shivakumar P

Reputation: 113

"No route matches" - Ruby on Rails

I am new to Ruby and Rails. This is my second application where I'm trying to implement login authentication.

Getting this error

No route matches "/user/process_login"

Here is my routes.rb

Myapp::Application.routes.draw do
  get "user/login"
  get "user/process_login"
end

On submit i am getting above error on login page. I think something has gone wrong in routes.rb or somewhere else.

Upvotes: 1

Views: 775

Answers (2)

stephenmurdoch
stephenmurdoch

Reputation: 34603

looks like you're trying to post to that route,

try changing your routes file to this:

post "user/process_login"

Upvotes: 2

edgerunner
edgerunner

Reputation: 14973

You need to do this in your routes.rb

get "user/login" => "users#login"
get "user/process_login" => "users#process_login"

on a side note, I highly recommend that you use post instead of get to process the login.

Upvotes: 1

Related Questions