5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/active_admin/globalize3_locale_selector/dsl.rb', line 5
def change_globalize3_locale(options={})
as = options[:as] || 'sidebar'
as = as.to_s
controller do
around_filter :force_globalize_locale
def force_globalize_locale
if params[:with_locale].present?
Globalize.with_locale(params[:with_locale]) do
yield
end
else
yield
end
end
end
if as == 'action_item'
action_item options do
render :partial => 'globalize3_locale_selector/action_item_form'
end
else
:show_with_locale, options do
render :partial => 'globalize3_locale_selector/sidebar_form'
end
end
end
|