Displaying 1 result from an estimated 1 matches for "set_event_url".
2006 Jul 19
1
How to add validation to in_place_editor
...a simple question, but can''t seem to figure this out.
I added an in place editor field and didn''t like how it didn''t use
the save method. It uses the update_attribute method which does not
run validation, etc. So I just added the method in my controller myself:
def set_event_url
begin
@event = Event.find params[:id]
@event.url = params[:value]
@event.save
render :text => @event.send(:url)
rescue Exception => error
render :text => error
end
end
The problem is that if there is an error that is rescued it sets tha...