Jeremy Jeremy - 1 year ago 103
Ruby Question

What does resource mean in Devise?

I want to change what happenes in devise when a user logs in.. When I look at the source code the word resource is everywhere, but I can't understand what it is a stand in for. Does it only pertain to devise and warden?

def after_sign_in_path_for(resource)
stored_location_for(resource) ||
if resource.is_a?(User) && resource.can_publish?

Answer Source

Resource is an abstraction name of instance of a user. It can be configured in devise settings to work with Admin model or any other.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download