私はaddress_picker-railsgemを使用しており、最初の入力では完全に機能しますが、何らかの理由で2番目の入力では機能しません。私は今それを百万回経験しました。何かご意見は?
Jqueryを使用した以下の_newフォームコード:
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being
saved:</h2>
<ul>
<% @post.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<fieldset>
<div class="field">
<%= f.label :from %><br />
<%= f.text_field :from, :class => 'address-picker-input' %>
</div>
</fieldset>
<fieldset>
<div class="field">
<%= f.label :to %><br />
<%= f.text_field :to, :class => 'address-picker-input' %>
</div>
</fieldset>
<script type="text/javascript">
//AddressPickerRails.Pickers.applyOnReady({
// 'onLoad':function (railsPicker) {
// console.debug("callback for a single post with ID '%s'",
railsPicker.getIdPrefix());
// }
//});
AddressPickerRails.Pickers.apply({
'onLoad':function (railsPicker) {
console.debug("callback for a single post with ID '%s'",
railsPicker.getIdPrefix());
}
});
</script>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
HTMLコード:
<div class="field">
<label for="post_to">To</label><br>
<input class="address-picker-input ui-autocomplete-input" id="post_to" name="post[to]"
size="30" type="text" autocomplete="off"><span role="status" aria-live="polite"
class="ui-helper-hidden-accessible">19 results are available, use up and down arrow
keys to navigate.</span>
</div>
<div class="field">
<label for="post_from">From</label><br>
<input class="address-picker-input" id="from_field" name="post[from]" size="30"
type="text">
</div>
何かご意見は?