Module: ActiveScaffold::Actions::FieldSearch

Includes:
CommonSearch
Defined in:
lib/active_scaffold/actions/field_search.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
# File 'lib/active_scaffold/actions/field_search.rb', line 4

def self.included(base)
  base.before_filter :search_authorized_filter, :only => :show_search
  base.before_filter :store_search_params_into_session, :only => [:index]
  base.before_filter :do_search, :only => [:index]
  base.helper_method :field_search_params
end

Instance Method Details

#show_searchObject

FieldSearch uses params and not @record because search conditions do not always pass the Model’s validations. This facilitates for example, textual searches against associations via .search_sql



13
14
15
16
# File 'lib/active_scaffold/actions/field_search.rb', line 13

def show_search
  @record = new_model
  respond_to_action(:field_search)
end