Displaying 1 result from an estimated 1 matches for "id_prog".
Did you mean:
d_prog
2007 Jan 10
6
Updating an attribute in db
...e, thus a rather simple question.
My list view shows table records and enables user to click a button in
order to change value of one attribute in given record. I use this code
to invoke a method from controller:
<%= button_to "Change", { :action => "edit", :id => prog.id_prog } %>
My method looks like this (just a simple one - to set the salary
attribute to 1000)
def edit
prog = Prog.find(params[:id])
prog.update_attribute(:salary, 1000)
redirect_to :action => ''list''
end
However after a list view is shown again the change is not ma...