undefined method `authenticate_user!'

220 views
Skip to first unread message

Boris Tuman

unread,
May 28, 2013, 10:38:46 AM5/28/13
to plataforma...@googlegroups.com
Hey, I have been getting a "undefined method `authenticate_user!'" error and I have searched the web, the devise github, Stackoverflow and here for solutions. None of the solutions I have found so far have helped. 
I found someone else posting about the exact same issue. 

Here is my route file 
:Application.routes.draw do  
  #resources :users
   devise_for :users
  

  resource :sessions, :only => [:new, :create, :destroy]

 devise_scope :user do
match 'signup' => 'users#new', :as => :signup

match 'register' => 'users#create', :as => :register

match '/login' => 'sessions#new', :as => :login

match 'logout' => 'sessions#destroy', :as => :logout
 end
  match '/activate/:activation_code' => 'users#activate', :as => :activate, :activation_code => nil

  resource :sessions
 #more resources. 
  
  match '' => 'home#index', :as => :home
 match ':controller(/:action(/:id))'
 root to: 'home#index'
end 


My controller that is generating the issue 
class HomeController < ApplicationController
  #skip_before_filter :login_required
 before_filter :authenticate_user!


  def index
    rederict_to Login_path, :status => 307 unless user_signed_in
   #redirect_to login_path, :status => 307 unless current_user
  end

end

I know the naming is correct. I have restarted my server. It might just be a routing issue. (I am working on adding device to a legacy application and am in the process of completing the move from the outdated Restful Authentication plugin, so I suspect that might have something to do with the issue) Thank you very much. 

Boris Tuman

unread,
May 28, 2013, 5:19:19 PM5/28/13
to plataforma...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages