Class: Releaf::SettingsController

Inherits:
ActionController show all
Defined in:
app/controllers/releaf/settings_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ActionController

#collection_given?, #confirm_destroy, #controller_scope_name, #create, #create_another?, #definition, #destroy, #destroyable?, #edit, #index, #new, #page_title, #prepare_create, #prepare_destroy, #prepare_edit, #prepare_index, #prepare_new, #prepare_resource_view, #prepare_show, #prepare_toolbox, #prepare_update, #required_params, #short_name, #show, #toolbox, #update

Methods included from Responders

#action_responder, #action_responders, #active_responder, #respond_with

Methods included from ActionController::Exceptions

#access_denied, #page_not_found

Methods included from ActionController::Layout

#layout_features

Methods included from ActionController::Views

#action_view, #action_views, #active_view

Methods included from ActionController::RichtextAttachments

#create_releaf_richtext_attachment, #releaf_richtext_attachment_upload_url

Methods included from ActionController::Breadcrumbs

#add_resource_breadcrumb, #build_breadcrumbs, #controller_breadcrumb

Methods included from ActionController::Urls

#current_path, #index_path, #resolve_index_path, #success_path, #valid_index_path?

Methods included from ActionController::Ajax

#ajax?, #layout, #manage_ajax

Methods included from ActionController::Features

#action_feature, #action_features, #feature_available?, #verify_feature_availability!

Methods included from ActionController::Search

#search, #searcher_class

Methods included from ActionController::Builders

#application_scope, #builder_class, #builder_scopes

Methods included from ActionController::Resources

#load_resource, #new_resource, #permitted_params, #resource_class, #resource_given?, #resources_per_page

Methods included from ActionController::Notifications

#notice_scope_name, #render_notification

Class Method Details

.resource_classObject



3
4
5
# File 'app/controllers/releaf/settings_controller.rb', line 3

def self.resource_class
  Releaf::Settings
end

Instance Method Details

#featuresObject



19
20
21
# File 'app/controllers/releaf/settings_controller.rb', line 19

def features
  [:index, :edit, :search]
end

#resource_paramsObject



15
16
17
# File 'app/controllers/releaf/settings_controller.rb', line 15

def resource_params
  {value: Releaf::Settings::NormalizeValue.call(value: super.fetch(:value, nil), input_type: @resource.input_type)}
end

#resourcesObject



7
8
9
# File 'app/controllers/releaf/settings_controller.rb', line 7

def resources
  resource_class.registered
end

#searchable_fieldsObject



11
12
13
# File 'app/controllers/releaf/settings_controller.rb', line 11

def searchable_fields
  [:var, :value]
end