1
link_to block
을 추가해야하지만 몇 가지 문제가 발생했습니다. 여기레일 js.erb 블록 추가 link_to
그것은 완벽하게 HTML의 벌금과 디스플레이를 작동 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 %>
이지만, 내가 추가 할 js.erb
을 사용하는 경우는 잘못 표시됩니다. js.erb에서
내가 그러나
$('#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 %>");
를 입력, 그것은 이름으로
path
인수했다 보인다이
처럼 표시됩니다.
당신은 단지 경로를 제공하는 대신보기를 렌더링하는 데 필요한 링크를 렌더링 –