0
파괴 작업에 변수를 전달해야합니다. 나는 이것을 시도했다.레일에서 리소스 작업에 변수를 전달할 수 있습니까
<%= link_to image_tag('18x18/Icon_3.png'), :url => {:action => :destroy, :startup => true}, :rel => "tooltip", :title => t('remove'), class: 'table-icon', method: :delete, data: {confirm: t('care_and_feed_delete_warning')} if can? :destroy, CareAndFeed %>
하지만 작동하지 않습니다. 하지만 이것은 완벽하게 작동합니다.
<%= link_to image_tag('18x18/Icon_3.png'), @care_and_feed, :rel => "tooltip", :title => t('remove'), class: 'table-icon', method: :delete, data: {confirm: t('care_and_feed_delete_warning')} if can? :destroy, CareAndFeed %>
이 작업을하려면 어떻게해야합니까?
당신은 URL 헬퍼를 사용해야합니다 – apneadiving
우리에게 해당 경로를 보여줄 수 있습니까? –