Topic: params[:controller] vs controller.controller_name

Any difference between;

params[:controller]

(and)

controller.controller_name


Pls explain; which is the best way to handle (performance-wise) and why?

Re: params[:controller] vs controller.controller_name

this is a guess...

i would imagine controller.controller_name is more secure because params could be vulnerable to user manipulation?

e.g.
http://your.domain.name/controller/list … dmin_panel

Re: params[:controller] vs controller.controller_name

nope. params[:controller] is set by the routes recognition, therefore overwriting any :controller params send with the request.

controller.controller_name infers the name from the class name, so there is some "calculation" goin on i guess, while params[:controller] simply reads from the params hash. But i don't think there is any measurable performance advantage to one of the approaches. do what feels better to you.