Thanks. But I think the application still needs something more.
I defined those methods in my application_controller and added to my
“requuire login Method”
alert: “Erst anmelden bitte!”
and added to my create method in the sessionscontroller:
user = User.find_by_username(params[:username])
if user && user.authenticate(params[:password])
session[:user_id] = user.id
notice: “logged in”
When I now want to retrieve a page, that has the befor_filter “require
I get the Error Message.
AbstractController::DoubleRenderError in GamesController#new
Render and/or redirect were called multiple times in this action. Please
note that you may only call render OR redirect, and at most once per
action. Also note that neither redirect nor render terminate execution
of the action, so if you want to exit an action after redirecting, you
need to do something like “redirect_to(…) and return”.
When logging in directly (without filters), I get the Error Message
ActionController::ActionControllerError in SessionsController#create
Cannot redirect to nil!