Skip to content

Instantly share code, notes, and snippets.

@JNajera
Created August 15, 2013 22:47
Show Gist options
  • Select an option

  • Save JNajera/6245671 to your computer and use it in GitHub Desktop.

Select an option

Save JNajera/6245671 to your computer and use it in GitHub Desktop.
Add refinerycms-page-images to a custom engine of RefineryCMS
// File @ vendor/extensions/products/app/admin/products
<div class='wym_skin_refinery page_part' id='page_image_picker'>
<%= render '/refinery/admin/pages/tabs/images_bar', :f => f %>
<%= render '/refinery/admin/pages/tabs/images_field', :f => f %>
</div>
<% content_for :stylesheets, stylesheet_link_tag('refinery/page-image-picker') %>
<% content_for :javascripts, javascript_include_tag('refinery/page-image-picker') %>
rails g refinery:engine products title:string description:text
# File @ vendor/extensions/products/app/models/refinery/products
has_many :image_pages, :as => :item, :order => 'position ASC'
has_many :images, :through => :image_pages, :order => 'position ASC'
has_many_page_images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment