mercredi 2 septembre 2015

How to render a file from Devise module?

I am using devise gem in my rails application for authentication. In idm_authenticatable.rb I have a method as follows..

 module Devise
  module Strategies
   class IdmAuthenticatable < Authenticatable
     def create_employee
       if !employee.save
         render 'devise/sessions/new'
       end
     end
   end
  end
 end

But the above method is throwing

 undefined method `render' for #<Devise::Strategies::IdmAuthenticatable:0x00000001771068>

I think we can't render from inside a Module. Is there any alternate way to render error page inside devise module?

Aucun commentaire:

Enregistrer un commentaire