I have a modal dialog box with form. I want to reload the page after closing the modal dialog box. How can I do this in Rails controller? plz help me... I am using rails 2.3.8 and following is my controller code for update a form.
def update
@event = Event.find(params[:id])
render :update do |page|
if @event.update_attributes(params[:event])
page<<"$j('#show_event_dialog').dialog('destroy')"
re开发者_如何学运维direct_to :controller => 'calendar', :action => 'index'
end
end
end
but this will return internal server error. How can I redirect to main page with the updated values?
I did this as follows...
page << 'window.location.reload()'
Now it is refreshing the page...
精彩评论