Module: Globalize2::GlobalizedFieldsControllerExtension

Defined in:
lib/globalize2/globalized_fields_controller_extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/globalize2/globalized_fields_controller_extension.rb', line 3

def self.included base
  base.prepend_before_filter :set_content_locale
end

Instance Method Details

#createObject



16
17
18
19
20
21
22
# File 'lib/globalize2/globalized_fields_controller_extension.rb', line 16

def create
  I18n.with_locale(Globalize2Extension.content_locale) do
    model.update_attributes!(params[model_symbol])
  end
  
  response_for :create
end

#updateObject



8
9
10
11
12
13
14
# File 'lib/globalize2/globalized_fields_controller_extension.rb', line 8

def update
  I18n.with_locale(Globalize2Extension.content_locale) do
    model.update_attributes!(params[model_symbol])
  end
  
  response_for :update
end