0

HI ,

I am very new to rails application .

I am trying to execute a method as long as the logged in user is alive. For that i have added a method on before_filter of application_controller

ANd my code is

before_filter :update_user

def update_user
   @user=current_user
   @user.update_attributes(:last_active=> Time.current)
   render :layout => false
end

But the above showing me some error.. How to resolve this ??

1 Answer 1

2

You should remove the render :layout => false line in the method. Otherwise it will not continue to the actual action that was routed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.