diff options
Diffstat (limited to 'vendor/extensions/gallery_links')
2 files changed, 8 insertions, 1 deletions
diff --git a/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb index b83cdd1..e275fb2 100644 --- a/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb +++ b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb @@ -3,6 +3,8 @@ module Refinery class GalleryLink < Refinery::Core::BaseModel self.table_name = 'refinery_gallery_links' + belongs_to :image, class_name: ::Refinery::Image + attr_accessible :title, :url, :photographer, :description, :image_id, :position validates :title, :presence => true, :uniqueness => true diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb index 0692e6c..1ec8b93 100644 --- a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb @@ -27,7 +27,12 @@ <div class='field'> <%= f.label :image_id -%> - <%= f.text_field :image_id -%> + <%#= f.text_field :image_id -%> + <%= render '/refinery/admin/image_picker', + :f => f, + :field => :image_id, + :image => @gallery_link.image, + :toggle_image_display => false -%> </div> <%= render '/refinery/admin/form_actions', :f => f, |