lib/trust/controller/resource.rb
def strong_params(new_action = new_action?)
        if params_handler.size > 0
          if params_handler[:require]
            new_action ?
              params.fetch(params_handler[:require], {}).permit(params_handler[:permit]) :
              params.require(params_handler[:require]).permit(params_handler[:permit])
          else
            params.permit(params_handler[:permit])
          end
        else
          instance_params
        end
      end
# Returns strong parameters for the instance (Rails 4)
# This call will take advantage of the spesified in permissions.
# If no such permissions is defined, it will fall back to instance_params
#
# ==== Example
#
#     # assume the following permissions defined
#     class Account < Default
#       require :account
#       permit :number, :amount
#     end
#
#     # in AccountsController
#     resource.strong_params  # same as params.require(:account).permit(:number, :amount)
#
#     # as a new action
#     resource.strong_params(true)  # same as params.fetch(:account, {}).permit(:number, :amount)
#
Returns strong parameters for the instance (Rails 4)
This call will take advantage of the spesified in permissions.
If no such permissions is defined, it will fall back to instance_params

Example

assume the following permissions defined
class Account < Default
require :account
permit :number, :amount
end




Returns strong parameters for the instance ( Rails 4 ) This call will take advantage of the spesified in permissions . If no such permissions is defined it will fall back to instance_params Example assume the following permissions defined class Account < Default require : account permit : number : amount end
def strong_params(new_action = new_action?)
        if params_handler.size > 0
          if params_handler[:require]
            new_action ?
              params.fetch(params_handler[:require], {}).permit(params_handler[:permit]) :
              params.require(params_handler[:require]).permit(params_handler[:permit])
          else
            params.permit(params_handler[:permit])
          end
        else
          instance_params
        end
      end
def strong_params ( new_action = new_action? ) if params_handler . size > 0 if params_handler [ :require ] new_action ? params . fetch ( params_handler [ :require ] , { } ) . permit ( params_handler [ :permit ] ) : params . require ( params_handler [ :require ] ) . permit ( params_handler [ :permit ] ) else params . permit ( params_handler [ :permit ] ) end else instance_params end end
Returns strong parameters for the instance (Rails 4)
This call will take advantage of the spesified in permissions.
Returns strong parameters for the instance ( Rails 4 ) This call will take advantage of the spesified in permissions .
new_action
new_action?