app/controllers/admin/cms_controller.rb
# Utility function that acquires a single item of content for use with the various CRUD functions in this controller.
#
# If an @id@ parameter is specified, it will attempt to load content with that particular ID from the database.
#
# === Parameters
#
# [update_from_params] _(bool)_ whether to try updating the content from inbound request parameters
Utility function that acquires a single item of content for use with the various CRUD functions in this controller.
If an @id@ parameter is specified, it will attempt to load content with that particular ID from the database.

Parameters

[update_from_params] _(bool)_ whether to try updating the content from inbound request parameters
Utility function that acquires a single item of content for use with the various CRUD functions in this controller . If an @id@ parameter is specified it will attempt to load content with that particular ID from the database . Parameters [ update_from_params ] _ ( bool ) _ whether to try updating the content from inbound request parameters
def extract_content( update_from_params = false )
      run_callbacks :content_extract do
        @content = params.key?( :id ) ? @model_class.find( params[:id] ) : @model_class.new
        @content.assign_attributes( get_assignable_params ) if update_from_params
        yield if block_given?
      end
      @form_context << @content
    end
def extract_content ( update_from_params = false ) run_callbacks :content_extract do @content = params . key? ( :id ) ? @model_class . find ( params [ :id ] ) : @model_class . new @content . assign_attributes ( get_assignable_params ) if update_from_params yield if block_given? end @form_context << @content end
Utility function that acquires a single item of content for use with the various CRUD functions in this controller.
Utility function that acquires a single item of content for use with the various CRUD functions in this controller .
# wrap in a callback so we can do things further down # load the object # if we’re trying to update things # call down, if we’ve been provided with a block # Add the content to our context
update_from_params