diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 14:37:39 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 14:37:39 +0100 |
commit | 9a5008f1b3ed11f3e052d156d1879cbb429106f8 (patch) | |
tree | f99a59fcc6521e80e286592daeb8dc17e28637f2 /vendor | |
parent | c9c1d27ae1de01e4fcf07f2c72042b471784260a (diff) | |
download | hmnoweb-9a5008f1b3ed11f3e052d156d1879cbb429106f8.tar.gz hmnoweb-9a5008f1b3ed11f3e052d156d1879cbb429106f8.tar.bz2 hmnoweb-9a5008f1b3ed11f3e052d156d1879cbb429106f8.zip |
GalleryLinks: Fix image upload
Diffstat (limited to 'vendor')
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, |