rails g migration add_key_image_to_refinery_page key_image_id:integer
rake db:migrate
rake refinery:override model=refinery/page
rake refinery:override view=refinery/admin/pages/_form
module Refinery | |
class Page < Refinery::Core::BaseModel | |
belongs_to :key_image, :class_name => '::Refinery::Image' | |
attr_accessible :key_image_id # You can actually just append :key_image_id to the existing list of attr_accessible items | |
# ... | |
end | |
end |
# ... | |
<div class='field'> | |
<%= f.label :background_image, 'Key Image' -%> | |
<em>Image size: 1280x960</em> | |
<%= render '/refinery/admin/image_picker', | |
:f => f, | |
:field => :key_image_id, | |
:image => @page.key_image, | |
:toggle_image_display => false %> | |
</div> | |
# ... |
nicinabox: I advise you add you have to add to this gist notion to add attr_accessible :key_image_id to the refinery/page.rb model