Ruby on rails params injection?

A. You can check user role in controller class User # remove available_to_admins from attr_accessible attr_accessible :name end def update @user = User. New(params:user) @user.

Available_to_admins = params:user:available_to_admins if current_user. Role == 'Admin' end b. You can add before_save / before_update callbacks to your model class User # remove available_to_admins from attr_accessible attr_accessible :name before_save :check_role before_update :check_role def check_role self.

Available_to_admins = params:user:available_to_admins if current_user. Role == 'Admin' end end.

A. You can check user role in controller. Class User # remove available_to_admins from attr_accessible attr_accessible :name end def update @user = User.

New(params:user) @user. Available_to_admins = params:user:available_to_admins if current_user. Role == 'Admin' end b.

You can add before_save / before_update callbacks to your model class User # remove available_to_admins from attr_accessible attr_accessible :name before_save :check_role before_update :check_role def check_role self. Available_to_admins = params:user:available_to_admins if current_user. Role == 'Admin' end end.

Thank you very much for your answer(s) fl00r! – Julien P. Apr 17 '10 at 13:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions