small medium large xlarge

08 Sep 2011, 15:50
Scott Herrington (6 posts)

I am getting the following error message after logging into the applicaiton. It look like the logout_path is not defined; however, I thought my route covered it.

NameError in Users#index

undefined local variable or method `logout_path'

Extracted source (around line #38):

35:           <li><%= link_to 'Products', products_path %></li>
36:           <li><%= link_to 'Users',    users_path    %></li>
37:         </ul>
38:         <%= button_to "Logout", logout_path, method: :delete   %>
39:       <% end %>
40: 		</div>
41: 		<div id="main">

My route looks like:

	controller :sessions do
		get 'login' => :new
		post 'login' => :create
		delete 'loqout' => :destroy
08 Sep 2011, 19:12
Sam Ruby (634 posts)

delete ‘loqout’ => :destroy

Looks like a typo (q instead of a g).

You must be logged in to comment