Module: Alchemy::Admin::PicturesHelper

Defined in:
app/helpers/alchemy/admin/pictures_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_or_assign_url(picture_to_assign, options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/helpers/alchemy/admin/pictures_helper.rb', line 5

def create_or_assign_url(picture_to_assign, options)
  if @content.nil?
    {
      :controller => :contents,
      :action => :create,
      :picture_id => picture_to_assign.id,
      :content => {
        :essence_type => "Alchemy::EssencePicture",
        :element_id => @element.id
      },
      :options => options
    }
  else
    {
      :controller => :essence_pictures,
      :action => :assign,
      :picture_id => picture_to_assign.id,
      :content_id => @content.id,
      :options => options
    }
  end
end