figured it out.
On Oct 28, 6:02 pm, about2flip <mnu...@gmail.com> wrote:
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---