I'm new to Ruby on rails and just installed an active admin and tried to set up
points of view.
I have a table of products and images. Each image belongs to one product.
Now I want to display a column with a related image when showing the product page.
At the moment, this is just the text image_url, which does not work. Later i would do
50x50px image will be displayed.
How to do it? (image model: name: string image_url: text)
Here is what I did:
ActiveAdmin.register Product do index do column "Image" do |image| image.image_url end column :name column :preview_text column :full_text column :price, :sortable => :price do |product| div :class => "price" do number_to_currency product.price end end default_actions end end
I don’t know how to fix this part using “make image”. I am a beginner in rails 2 days exp ..
The syntax seems to be wrong and the throwing error:
undefined method `image_url' for #<Product:0x00000101b5a458>
thanks
zer02
source share