Search code examples
ruby-on-railsrefinerycms

RefineryCMS Reusing partials


What I am trying to do is use the refinery/admin/images/insert template to insert images in my own engine.. I am a complete noob at rails and refinerycms... Any help regarding this would be much appreciated


Solution

  • If this is a Refinery engine, you can generate image insertion support by specifying the field as an image when you generate it:

    rails generate refinery:engine title:string image:image
    

    Refinery understands that, when you say something is an image, it should convert this to a link to the image insertion functionality for you.

    Don't worry if you have an existing extension, you can just generate a new one and copy what gets generated for the image support into your one.