a method starting find_all_by
will return an array of Active record instances... not just a single one. update
only works on a single instance.
So, either you want to run through all the instances in the array... using an each
- or you want to just fetch the first one using find_by
instead of find_all_by
In the case of finding by an id... I'd recommend changing it to find_by
so:
@finance = Finance.find_by_user_id current_user[:id]
@finance.update_attributes(params[:finance])