Running Rails 3. Included "include Rails.application.routes.url_helpers" in model file of users. Still getting this error. Any idea??
# cat app/models/user.rb
class User < ActiveRecord::Base
include Rails.application.routes.url_helpers
acts_as_authentic
end
# rake routes
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
root / users#index
# cat config/routes.rb | grep -v '#'
www::Application.routes.draw do
resources :users
end
Error -
Showing /var/www/app/views/users/index.html.erb where line #7 raised:
undefined local variable or method `new_user_session_path' for #<#<Class:0x9a51c6c>:0x9bb6170>
Extracted source (around line #7):
4:
5: <p>Public Facing Content</p>
6:
7: <%= link_to 'Login', new_user_session_path %>