Displaying 1 result from an estimated 1 matches for "updatetopic".
2005 Dec 16
12
validates_presence_of not working
...=> :update parameter to the validation method calls in my model, but
that made no difference (I don''t understand that parameter anyway; I
want the validation enforced whether I am saving or updating or
creating, is there a way to specify all?)
Here is the controller method:
def updatetopic
fields = params[:topic]
# if checkbox was unchecked, mark it false
if fields[:inlibrary] == nil
fields[:inlibrary] = false
end
Topic.update(params[:id], fields)
msg = "Updated Topic Successfully"
flash[:notice] = msg
redirect_to(:action => "...