레일즈 3.2.3 어플리케이션에서 Ajax와 jQuery를 사용하고 있습니다. 페이지에 링크가 있으며 단추로 바꾸고 싶습니다. 아래의 코드는 완벽한레일즈 - link_to and button_to
<%= link_to "More", {:controller => "home", :action => "test_method", :page=>@current_page }, :remote => true,:id => 'lnk_more' %>
을하고있다하지만이 하나가 링크와 버튼
<%= button_to "More", {:controller => "home", :action => "test_method", :page=>@current_page }, :remote => true,:id => 'lnk_more' %>
결과 HTML을하지 않는 것은 내가 잘못했을 여기에서
#link
<a href="/home/test_method?page=1" data-remote="true" id="lnk_more" disabled="disabled">More </a>
#button
<form action="/home/test_method?page=1" class="button_to" data-remote="true" method="post"><div><input id="lnk_more" type="submit" value="More "><input name="authenticity_token" type="hidden" value="hFCuBR+88FYKEvNTZok+QRhxf6fHA+ucC6i2yc9hBEk="></div></form>
입니다 ?
작동하지 않습니다. '@ current_page'는 어디에 있습니까? – Alexandre
매개 변수'id'는 어디에 있습니까? – Alexandre
@AlexMaslakov,이 컨텍스트의 매개 변수는 페이지입니다. –