help me with this question:
I have 2 models (admin and user) -> created using development, and I have post_controller:
and the question arises:
If I have one model (user.rb) -> in my controller, I will put this:
before_filter :authenticate_user!, :except => [:show, :index]
but I have 2 models, and I want the User to have access to the "show" and "index" actions of the post-controller, and the administrator has access to all actions.
and I am doing something like this:
before_filter :logged_in . . . private def logged_in if admin_signed_in? else authenticate_user! end end
but I want to change my line:
authenticate_user!
like that:
:authenticate_user!, :except => [:show, :index]
but besides links to before_filter
how can i do this (without cancan gem)
source share