app/controllers/application_controller.rb
# used as a before_filter on methods that you don't want users to see if they are logged in
# such as the sessions#new, users#new, users#forgot_password etc
used as a before_filter on methods that you don't want users to see if they are logged in
such as the sessions#new, users#new, users#forgot_password etc
used as a before_filter on methods that you don ' t want users to see if they are logged in such as the sessions#new users#new users#forgot_password etc
def redirect_if_already_logged_in
    if logged_in?
      flash[:notice] = I18n.t(:destination_inappropriate_for_logged_in_users)
      return redirect_to(current_user) if params[:return_to].nil?
      return redirect_to(params[:return_to])
    end
  end
def redirect_if_already_logged_in if logged_in? flash [ :notice ] = I18n . t ( :destination_inappropriate_for_logged_in_users ) return redirect_to ( current_user ) if params [ :return_to ] . nil? return redirect_to ( params [ :return_to ] ) end end
used as a before_filter on methods that you don't want users to see if they are logged in
such as the sessions#new, users#new, users#forgot_password etc
used as a before_filter on methods that you don ' t want users to see if they are logged in such as the sessions#new users#new users#forgot_password etc