을 업데이트하여 다음과 같은 체크 박스를 확인하고 라디오 버튼 내 listings_controller 나는 그런 일이 어떻게해야합니까checkbox_tag - 내가 좋아하는 것 AJAX 모델
에서 "업데이트"메소드를 호출? 내 테이블에 요소를 코딩했지만 어떻게 매개 변수를 보낼 수 있습니까? AJAX를 사용하고 싶습니다. 어디에서 시작해야합니까?
<%= stylesheet_link_tag 'listings' %>
<h1>Listing listings</h1>
<table class="datatable">
<tr id="heading" >
<th >id</th>
<th >name</th>
</tr>
<% @listings.each do |listing| %>
<tr id="body">
<th><%=listing.id%></th>
<th><%= link_to listing.name, edit_listing_path(listing) %></th>
#How can I have the following invoke the update method in AJAX format
<td><%= radio_button_tag(:keep, "Keep") %>
<%= label_tag(:keep, "Keep") %></td>
<td><%= radio_button_tag(:keep, "Delete") %>
<%= label_tag(:keep, "Delete") %></td>
<td><%= check_box_tag(:checked) %>
<%= label_tag(:checked, "checked") %></td>
<td><%= check_box_tag(:collected) %>
<%= label_tag(:collected, "collected") %></td>
<td><%= check_box_tag(:digitized) %>
<%= label_tag(:digitized, "digitized") %></td>
<td><%= check_box_tag(:in_database) %>
<%= label_tag(:in_database, "in database") %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Listing', new_listing_path %>
고마워요.
여기에 대한 자습서를 제안 할 수 있습니까? 나는 모델과 대화하는 테이블에있는 체크 박스를 찾으려고 노력하고 있습니다. - 감사합니다. – banditKing
AJAX가 정상적으로 처리 할 수있는 유형이라고 생각하면, 튜토리얼에 대해 묻는 것이 너무 사소한 것입니다. jQuery 및 AJAX 요청을 배우는 데 약간의 시간을 투자하십시오. 계속 진행하려면 지식이 필요합니다. –
방향에 대해 감사드립니다. – banditKing