0
我有如下link_to標籤但我不知道如何添加html class屬性,並解釋我的代碼edit_course_path(course).. does。我是新來的軌如何在rails 2.3.5中添加類到link_to
<% @courses.each do |course| %>
<li class="list<%=cycle('odd', 'even')%>">
<div class="category-edit"><%= link_to "#{t('edit_text')}", edit_course_path(course) if permitted_to? :edit, :courses %></div>
<div class="category-delete"> <%= link_to(t('delete_text'), course_path(course), :method => 'delete', :confirm => "#{t('delete_confirm_msg')}") if permitted_to? :destroy, :courses %></div>
</li>
<% end %>
沒有它不工作 – 2013-05-08 07:09:32
我已經更新了我的代碼 – 2013-05-08 07:11:51