Module: ActiveScaffold::Actions::Mark

Defined in:
lib/active_scaffold/actions/mark.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
# File 'lib/active_scaffold/actions/mark.rb', line 3

def self.included(base)
  base.before_action :mark_authorized_filter, :only => :mark
  base.before_action :assign_marked_records_to_model
  base.helper_method :marked_records
end

Instance Method Details

#markObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/active_scaffold/actions/mark.rb', line 9

def mark
  if mark? || mark_all_scope_forced?
    do_mark
  else
    do_demark
  end
  if marked_records.any?
    count = marked_records.length
    flash[:info] = as_(:records_marked, :count => count, :model => active_scaffold_config.label(:count => count))
  end
  respond_to_action(:mark)
end