Ruby on Rails

How to use devise forms in any page

How to use devise forms in any page? Add these code snippet in your application_helper.rb

module ApplicationHelper
    def resource_name
        :user
    end
 
    def resource
        @resource ||= User.new
    end

    def resource_class
        User
    end
 
    def devise_mapping
        @devise_mapping ||= Devise.mappings[:user]
    end
end

 

 

Fool Dev

I didn't get trained by the school system like other kids, and when I did concentrate on learning, my mind was cluttered and locked by the programming of the system. © Huey Newton