'book/review', params #=> controller == 'books/reviews'
 'book/review', params, 'reviews' #=> controller == 'reviews'
554168
def allowed_params_for(resource, params, controller=nil)
      controller  = set_controller(resource, controller)
      resource    = set_resource(resource)

      current_permission = load_permission(controller)

      if current_permission && current_permission.allowed_params
        params.require(resource).permit *current_permission.allowed_params
      end
    end
499634
def create
      # TODO: use the has_many associations -> @app.reviews.build
      @app_review = review_klass.new(review_params)
      if @app_review.save
        after_save
        render :show
      else
        render json: @app_review.errors, status: :bad_request
      end
    end
504282
def index
      @app_reviews = review_klass.approved
      @app_reviews = @app_reviews.limit(params[:limit]) if params[:limit]
      @app_reviews = @app_reviews.skip(params[:offset]) if params[:offset]
      @app_reviews = @app_reviews.order_by(params[:order_by]) if params[:order_by]
      @app_reviews = @app_reviews.where(params[:where]) if params[:where]

      @app_reviews = scope_app_reviews

      @app_reviews = @app_reviews.all.fetch
      response.headers['X-Total-Count'] = @app_reviews.metadata[:pagination][:count]
    end
36220
function (params) {
        this.query = params.q !== undefined ? String(params.q) : defaultParams.query;
        this.page = params.p !== undefined ? parseInt(params.p, 10) : defaultParams.page;
        switch (params.s) {
          case 'name':
          case 'owner':
          case 'stars':
          case 'updated':
            this.sorting = params.s;
            break;
          default:
            this.sorting = defaultParams.sorting;
        }
        switch (params.o) {
          case 'asc':
          case 'desc':
            this.order = params.o;
            break;
          default:
            this.order = defaultParams.order;
        }
      }
1327270
def param_filter *args, **kwds, &blk
      if blk
        ParamFilter.with_block( self, *args, **kwds, &blk )
      else
        ParamFilter.with_methods( self, *args, **kwds )
      end
    end
1280496
def each(&block)
      @results ||= get(Nominatim.config.search_url, @criteria).body.map! { |attrs| Nominatim::Place.new(attrs) }
      @results.each(&block)
    end
621229
def show
      if params[:id]
        @content = Content.find(params[:id])
      elsif params[:element_id] && params[:name]
        @content = Content.find_by!(element_id: params[:element_id], name: params[:name])
      end
      authorize! :show, @content
      respond_with @content
    end
358929
function (params) {

			return _.every(_.keys(params), function (key) { 
				return _.contains(put_params, key); 
			});
		}
136299
def build
      controller_name = @klass.name.gsub(/Controller$/, '').underscore
      Rails.application.routes.routes.each_with_object({}) do |route, comments|
        if route.defaults[:controller] == controller_name
          verb_match = route.verb.to_s.match(/\^(.*)\$/)
          verbs = verb_match.nil? ? '*' : verb_match[1]
          (comments[route.defaults[:action]] ||= []) << "#{verbs} #{route.ast}"
        end
      end
    end
522448
def map_search_params(search_params)
      Hash[search_params.map {|k, v| [key_map[k], v] }]
    end
555812
function Scope(site, page, params) {
	this.site = site
	this.page = page
	this.params = params || {}
	this.status = 200
	this._headers = {}
	this.locale = site.locales.default

	// Set default headers.
	this.header("Content-Type", "text/html; charset=utf-8")
	this.header("Connection", "close")
	this.header("Server", "Skira")
}
400760
function (options) {
            if (this.options) {
                options = _.extend({}, _.result(this, 'options'), options);
            }
            _.extend(this, _.pick(options, controllerOptions));
            this.options = options;
        }
256855
def parameter(name, params = Hash.new, &block)
      # pupu :autocompleter, type: "request"
      # @pupu.params: { type: "request" }

      # pupu :mootools, more: true
      # @pupu.params: { more: true }
      if @pupu.params.key?(name)
        block.call(@pupu.params[name])
      end
    end
108416
function (params) {
            if (! this.active) {
                return;
            }

            var paramsArr = Array.prototype.slice.call(arguments),
                n = this._bindings.length,
                bindings;

            if (this.memorize) {
                this._prevParams = paramsArr;
            }

            if (! n) {
                //should come after memorize
                return;
            }

            bindings = this._bindings.slice(); //clone array in case add/remove items during dispatch
            this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.

            //execute all callbacks until end of the list or until a callback returns `false` or stops propagation
            //reverse loop since listeners with higher priority will be added at the end of the list
            do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false);
        }
508250
def index
      if params[:terms]
        # For search mode
        @dashboard_templates = []
        JSON.parse(params[:terms]).map { |t| @dashboard_templates = @dashboard_templates | dashboard_templates.where(Hash[*t]) }
        response.headers['X-Total-Count'] = @dashboards_templates.count
      else
        @dashboard_templates = dashboard_templates
        @dashboard_templates = @dashboard_templates.limit(params[:limit]) if params[:limit]
        @dashboard_templates = @dashboard_templates.skip(params[:offset]) if params[:offset]
        @dashboard_templates = @dashboard_templates.order_by(params[:order_by]) if params[:order_by]
        @dashboard_templates = @dashboard_templates.where(params[:where]) if params[:where]
        @dashboard_templates = @dashboard_templates.all.fetch
        response.headers['X-Total-Count'] = @dashboard_templates.metadata[:pagination][:count]
      end
    end
1350137
def find_controller_by(params)
      model_class = find_model_class_by params
      Map.controller_map(model_class, params[:resources_controller]) || default_controller(params)
    end
785845
def active_page?(pages = {})
      is_active = pages.include?(params[:controller])
      is_active = pages[params[:controller]].include?(params[:action]) if is_active && !pages[params[:controller]].empty?
      is_active
    end