I am customizing the index form in active admin. I have some columns like:
column :id
column :name
I want to set the width of those columns. Is there an easy way?
for example:
column :name do |name|
div :class => "name" do
name
end
end
then in app/assets/stylesheets/active_admin.css.scss
file:
div.name { width: 500px; }
this should work I guess
The easiest way would be to wait for a version of active_admin that offers the feature Greg Bell talks about in https://github.com/gregbell/active_admin/issues/63
There is currently not an 'easy way' to do this.
No need to create any div class. For:
column :name
In app/assets/stylesheets/active_admin.css.scss
file write:
.active_admin {
.index_as_table {
td.name {
max-width: 150px;
min-width: 100px;
}
}
}
To set the max-width of the columns admin panel wide write:
.active_admin {
.index_as_table {
td {
max-width: 150px;
}
}
}
If you're using other index renderers, just have a look the source html and tweak the active admin stylesheet accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With