Reputation: 11026
I'd like to have my numbers right aligned and with a thousands separator. Can someone point me in the right direction?
ActiveAdmin.register Thing do
index do
column :id
column :amount # need to make this fomatted nicely
default_actions
end
end
Upvotes: 6
Views: 3910
Reputation: 806
Alternately:
column :amount, :class => 'text-right' do |thing|
number_to_currency thing.amount
end
then in your CSS
.text-right { text-align: right;}
Upvotes: 5
Reputation: 4606
you can use Active Admin Addons gem to improve the UI
https://github.com/platanus/activeadmin_addons/blob/master/docs/number-formatting.md
Upvotes: 1
Reputation: 2258
You can pass a block to the column.
column :amount do |thing|
div :class => "amount" do
number_to_currency thing.amount
end
end
css
.amount {
text-align :right;
}
This railscast goes through some pretty good info too http://railscasts.com/episodes/284-active-admin?view=asciicast
Upvotes: 13