【发布时间】:2014-04-11 16:20:36
【问题描述】:
Rails-haml 专家可以翻译一下,这个haml代码是如何翻译成html的? 该页面源自此 url 。我只对第 1 行和第 12 行感兴趣。我使用了各种工具,在线转换器,但似乎不起作用:(
%table.table.table-bordered.table-striped#sortable{:data => {update_url:
sort_admin_things_path}}
%thead
%tr
%th= Title
%th= Description
%th
%tbody
- @things.each do |thing|
# make the <tr>'s draggable by adding the expected '.item' class
# pass the item id into params[:id]
%tr{data: {item_id: "#{thing.id}"}, class: 'item'}
%td= thing.title
%td= thing.description.truncate(20)
%td
= link_to 'show', admin_thing_path(thing), :class => 'btn'
= link_to 'edit', edit_admin_thing_path(thing), :class => 'btn btn-primary'
= link_to 'destroy', admin_thing_path(thing), method: :delete, confirm: "Are you sure?", :class => 'btn btn-danger'
【问题讨论】:
标签: ruby-on-rails-4 haml