View:
form_tag(url_for(:controller => :matchers,
:action => :show_matched_alarms_list),
:remote => true,
:method =>:get,
:class => "matcher_ajax_form") do |f|
Controller:
layout 'application',:except=>[:show_matched_alarms_list]
def show_matched_alarms_list
@matcher= ...
render :update do |page|
page.replace('matched_alarms_list',
:partial => 'matchers/matched_alarms_list',
:locals=>{:matcher=>@matcher})
end
end
This is opening the Returned Javascript in a new page instead of load开发者_如何学Cing it in the opened page. Does anyone know how to fix this?
I am using prototype. The form looks like this:
<form accept-charset="UTF-8"
action="/matchers/show_matched_alarms_list"
class="matcher_ajax_form"
data-remote="true"
method="get">
I have fixed this.
The problem was that I submiting the form using the form.submit() method, which apparently doesn not work fine when using a remote form. I replaced it for the form.request() method and it worked as expected.
精彩评论