rookieRailer
rookieRailer

Reputation: 2341

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 using the user submitted parameters to check conditions. I just want to make sure if this is a good practice of RoR programming.

Upvotes: 0

Views: 88

Answers (1)

Spyros
Spyros

Reputation: 48626

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.

Upvotes: 2

Related Questions