Module: Avo::CommonController

Included in:
ApplicationController
Defined in:
app/controllers/concerns/avo/common_controller.rb

Instance Method Summary collapse

Instance Method Details

#default_url_optionsObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/concerns/avo/common_controller.rb', line 3

def default_url_options
  result = super.dup
  result[:force_locale] = params[:force_locale]

  extra_default_url_options.each do |param_name|
    result[param_name] = params[param_name]
  end

  result.compact
end

#extra_default_url_optionsObject



14
15
16
17
18
19
20
21
# File 'app/controllers/concerns/avo/common_controller.rb', line 14

def extra_default_url_options
  block_or_array = Avo.configuration.default_url_options
  if block_or_array.respond_to?(:call)
    instance_eval(&block_or_array)
  else
    block_or_array
  end
end