Reputation: 731
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')"
redirect_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?
Upvotes: 0
Views: 1737
Reputation: 731
I did this as follows...
page << 'window.location.reload()'
Now it is refreshing the page...
Upvotes: 1