Need some help in plugin development.
I've created hook in user/edit form view, added ballance_amount
to form and have "ballance_amount"=>"1"
.
How can I extend default update action in user controller?
In base.class_eval do
I've added alias_method_chain :update, :ballance
In InstanceMethods
:
def update_with_ballance
ballance.amount = params[:user][:ballance_amount].to_f #I have ballance association
end
And get this:
NameError (undefined local variable or method `params' for #<User:0x007f972e9379d0>):
app/controllers/users_controller.rb:144:in `update'
How can I fetch params?