File upload with Activeadmin Rails using paperclip

前端 未结 4 488
遥遥无期
遥遥无期 2020-12-07 10:04

I use Active admin as my rails application backend. I want to make a file upload. How can I accomplish this functionality?

4条回答
  •  失恋的感觉
    2020-12-07 10:18

    I'm using the rails 3.0.1 and the following code

    f.input :image, :hint => "current image: #{f.template.image_tag(f.object.image.url(:thumb))}" 
    

    return a string. After search a solution, i found it.

    f.input :image, :hint => f.template.image_tag(f.object.image.url(:thumb))
    

    Send direct the object, will return a image to the html

提交回复
热议问题