how to add new item inside show table active admin in rails ?
i try this code :
show do |ad|
default_main_content
attributes_table do
row "States : "
row ad.states.map(&:name)
end
end
but the "States" not add inside table?
If you don't want to lose default attributes (database columns) just do:
show do
attributes_table(*default_attribute_table_rows) do
row "My new row description" do
My row value
end
end
end
Your new row will be displayed at the bottom of the table
this is my code :
show do |ad|
attributes_table do
row :id
row :name
row :featured
row :url
row :amount
row :application_deadline
row :accreditation
row :created_at
row :updated_at
row :degree_type
row :states_name do
ad.states.map(&:name)
end
row :description
row :slug
row :deadline
row :degree_string
row :image_file_name
row :image_content_type
row :image_file_size
row :image_updated_at
row :real_amount
row :real_deadline
end
end
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