Class: Preflex::PreferencesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Preflex::PreferencesController
- Defined in:
- app/controllers/preflex/preferences_controller.rb
Instance Method Summary collapse
-
#update ⇒ Object
POST /preferences Params: klass name value.
Instance Method Details
#update ⇒ Object
POST /preferences
Params:
klass
name
value
8 9 10 11 12 13 14 |
# File 'app/controllers/preflex/preferences_controller.rb', line 8 def update klass = params[:klass].constantize raise "Expected #{params[:klass]} to be a subclass of Preflex::Preference" unless klass < Preflex::Preference klass.set(params[:name], params[:value]) head :ok end |