Resting Pug logo Resting Pug

Description

Filters subjects using filter params

Tip

Override this method to change how subjects are filtered

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

  private
  # Override a filter_subjects method to remove default scope beforehand.
  def filter_subjects
    @subjects = @subjects.unscoped.where(filter_params)
  end
end

Source code

# lib/resting_pug/modificators.rb

def filter_subjects
  @subjects = @subjects.where(filter_params)
end
Find me on GitHub