开发者

how to reload a page after closing modal dialog box in rails?

开发者 https://www.devze.com 2023-04-10 04:42 出处:网络
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 cont

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消