Module: Manage::AssetsHelper

Defined in:
lib/generators/freeberry/base/templates/helpers/manage/assets_helper.rb

Instance Method Summary collapse

Instance Method Details

#manage_assets_path_with_session_information(klass = 'Asset', options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/freeberry/base/templates/helpers/manage/assets_helper.rb', line 3

def manage_assets_path_with_session_information(klass = 'Asset', options = {})
  options = { :format => :xml, :protocol => "http://" }.merge(options)
  session_key = Rails.application.config.send(:session_options)[:key]
  
  options[session_key] = Rack::Utils.escape(cookies[session_key])
  options[:klass] = klass
  
  if protect_against_forgery?
    options[request_forgery_protection_token] = Rack::Utils.escape(form_authenticity_token)
  end
  
  manage_assets_url(options)
end