2015-09-26 69 views

回答

1

在这里,您可以查看角色也

class ApplicationController < ActionController::Base 
    def after_sign_in_path_for(resource) 
    if (###check current_user is admin ###) 
    ### your redirection ### 
    else 
    ### other redirection ### 
    end 
    end 
end 
+0

重定向似乎不起作用。当我尝试时,我会得到DoubleRenderError。 –

+1

明白了:store_location_for(resource,admin_root_path)为我工作。 –