I\'m following the Rails 4 In action book and I\'m running into the following error:
No route matches [POST] \"/sessions/new\"
I\'m not sure w
You are correct there is an error in this book.
When you have a form for tag
<%= form_for :signin, method: "POST" do |f| %>
If rails doesn't know what :signin
means, then it will simply copy the current url and will submit the form to that url (in this case 'sessions/new'), using the post verb (whether you specify it or not!)
<form accept-charset="UTF-8" action="/sessions/new" method="post">
....
Obviously, that's not necessarily what you want because you don't have a /sessions/new for post HTTP verb, I think the easiest solution would be to specify a route
post "/signin", to: "sessions#create", as: "signin"
and in your form_for
<%= form_for signin_path do |f| %>