简体   繁体   English

在每次方法调用之前如何从ApplicationController调用方法?

[英]How do a call a method from the ApplicationController before every method call?

I'm trying to do this update_activity_time everytime a user does something in the app. 每当用户在应用程序中执行某项操作时,我都在尝试执行此update_activity_time

Ive done this http://blog.tmisoft.com/2009/09/restful-authentication-session-timeout.html 我已经完成了http://blog.tmisoft.com/2009/09/restful-authentication-session-timeout.html

the error I get is undefined local variable or method when I did 我收到的错误是未定义的局部变量或方法

before_filter update_activity_time at the top of my controller. 我控制器顶部的before_filter update_activity_time。

您需要before_filter :update_activity_time

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM