remoteパラメーターを使用して、フォームとリンクにAjax を使用した Rails 3.2.13 アプリがあります。問題は、テキスト フィールドで同じことを行う方法がドキュメントで見つからないことです。リモート パラメーターが機能しなかったため、入力オブジェクトではサポートされていないと思います。
text_field オブジェクトでバインド 'ajax:xxx' イベント ('ajax:success' など) を実行したいと考えています。これはUJSでも可能ですか?そうでない場合、どのような選択肢がありますか?
ここにいくつかのコードがあります:
<%= form_for @post, :html => {:class => 'form-horizontal'} do |f| %>
<div class = 'control-group'>
<%= f.label :title, :html => {:class => 'control-label'} %>
<%= f.text_field :title, :placeholder => 'Title', :class => 'input-xxlarge' %>
</div>
<div class = 'control-group'>
<%= f.label :body, :html => {:class => 'control-label'} %>
<%= f.text_area :body, :placeholder => 'Your post here', :class => 'input-xxlarge',
:rows => 15 %>
</div>
<div class = 'control-group'>
<%= f.label :tags, :html => {:class => 'control-label'} %>
<%= f.text_field :tags, :placeholder => 'Tags separeted by ,', :class => 'input-xxlarge',
:value => '' %>
</div>
<%= f.submit 'Create', :class => 'btn btn-primary'%>
ありがとう!