我想讓我的號碼對齊,並與千位分隔符。有人能指引我朝着正確的方向嗎?Rails的ActiveAdmin索引格式編號
ActiveAdmin.register Thing do
index do
column :id
column :amount # need to make this fomatted nicely
default_actions
end
end
我想讓我的號碼對齊,並與千位分隔符。有人能指引我朝着正確的方向嗎?Rails的ActiveAdmin索引格式編號
ActiveAdmin.register Thing do
index do
column :id
column :amount # need to make this fomatted nicely
default_actions
end
end
您可以將一個塊傳遞給該列。
column :amount do |thing|
div :class => "amount" do
number_to_currency thing.amount
end
end
CSS
.amount {
text-align :right;
}
這railscast經過一些非常好的信息也http://railscasts.com/episodes/284-active-admin?view=asciicast
或者:
在你的CSScolumn :amount, :class => 'text-right' do |thing|
number_to_currency thing.amount
end
然後
.text-right { text-align: right;}