I am a Ruby newbie, 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:
However after a list view is shown again the change is not made to the
database. I do not get it, as find returns the proper record and
update_attribute returns true. What may be wrong?
However after a list view is shown again the change is not made to the
database. I do not get it, as find returns the proper record and
update_attribute returns true. What may be wrong?
Thanks in advance
I believe you need a ‘prog.save’ in there, before the redirect_to
However after a list view is shown again the change is not made to
the
database. I do not get it, as find returns the proper record and
update_attribute returns true. What may be wrong?
Thanks in advance
I believe you need a ‘prog.save’ in there, before the redirect_to
No, update_attribute automatically saves the record:
Does the code work when executed from the console?
One thing you might like to try is logging an inspection of the prog
object to see if that gives any insight: