开发者

Good practice on ApplicationController

I am working on an application and I have quite some number of methods in the ApplicationController file. However, I find myself using a lot of params[:some_param] in my methods, which means that I am directly usin开发者_如何学编程g the user submitted parameters to check conditions. I just want to make sure if this is a good practice of RoR programming.


Definitely not a good practice. Generally speaking, application controller code should be very limited, if any. If you feel that you need code for various models, you should most probably use a module. I would highly recommend that you refactor your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜