Hi:
I am a newbie at ROR, and I am grasping my head around Authlogic. I am having hard time trying to figure out how can I do the following:
in my application controller I have the following helpers:
filter_parameter_logging :password, :password confirmattion
helper_method :all
private def current_user_session return @current_user_session if defined? (@current_user_session) @current_user_session = UserSession.find end
def current_user return @current_user if defined?(@current_user) @current_user = current_user_session && current_user_session.user end
def require_user unless current_user store_location flash[:notice] = "You must be logged in to access this page" redirect_to new_user_session_url return false end
end
Now I want only users to be logged in to upload photos. So if the hit the upload link it takes them to a page, and the page tells them they have to logged in to upload. Once they register or login it takes them to another view that has the link for them to upload their picture.
Can someone tell me how I do this. I really appreciate your help.
Thanks in advance