1
link_to block
を追加する必要がありますが、いくつかの問題が発生しました。ここでRails js.erb append block link_to
は、それが正常に動作し、HTMLに完全に表示しますが、私は追加するjs.erb
を使用する場合、それは誤って表示していましたlink_to block
<%=link_to user_create_question_sort_section_path, :remote=> true , :method=> :post do %>
<button class="btn glyphicon glyphicon-sort-by-attributes"></button>
<% end %>
です。私は
$('#sort_btn').append("<%= j link_to user_create_question_sort_section_path, :remote=> true , :method=> :post do %><button class="btn glyphicon glyphicon-sort-by-attributes"></button><% end %>");
を入力js.erbで
しかし、それは名前としてpath
引数を取ったようで、この
のように表示されます。
は、あなただけのパスを与えるのではなく、ビューをレンダリングする必要がリンクをレンダリング –