私のフォーム
<%= form_tag load_link_path, :remote => true, :html => { :'data-type' => 'html', :id => 'load_link_form' } do %>
<fieldset>
<%= url_field_tag(:url) %>
<div class="validation-error"></div>
<%= submit_tag %>
</fieldset>
<% end %>
私の行動
def load
format.js
end
私のjsビュー(load.js.erb)
alert(0);
フォームを送信すると、アラートが発生しません。コンソール出力:
Processing by LinksController#load as JS
Parameters: {"utf8"=>"✓", "commit"=>"Save changes", "url"=>"http://www.alfajango.com/blog/rails-3-remote-links-and-forms/", "authenticity_token"=>"KWwfZH+sivCrWdlVBUPM0MBRPHzcDhmbB96ckLQ82Dg="}
Rendered links/load.js.erb (0.4ms)
Completed 200 OK in 2822ms (Views: 9.9ms | ActiveRecord: 0.0ms)