Class: ActiveScaffold::Config::List::UserSettings
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb
Instance Method Summary collapse
- #count_includes ⇒ Object
-
#label ⇒ Object
This label has alread been localized.
- #page ⇒ Object
- #page=(value = nil) ⇒ Object
- #per_page ⇒ Object
- #sorting ⇒ Object
Instance Method Details
#count_includes ⇒ Object
137 138 139 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 137 def count_includes @conf.count_includes end |
#label ⇒ Object
This label has alread been localized.
105 106 107 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 105 def label @session[:label] ? @session[:label] : @conf.label end |
#page ⇒ Object
114 115 116 117 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 114 def page @session['page'] = @params['page'] if @params.has_key? 'page' @session['page'] || 1 end |
#page=(value = nil) ⇒ Object
119 120 121 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 119 def page=(value = nil) @session['page'] = value end |
#per_page ⇒ Object
109 110 111 112 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 109 def per_page @session['per_page'] = @params['limit'].to_i if @params.has_key? 'limit' @session['per_page'] || @conf.per_page end |
#sorting ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb', line 123 def sorting # we want to store as little as possible in the session, but we want to return a Sorting data structure. so we recreate it each page load based on session data. @session['sort'] = [@params['sort'], @params['sort_direction']] if @params['sort'] and @params['sort_direction'] @session['sort'] = nil if @params['sort_direction'] == 'reset' if @session['sort'] sorting = @conf.sorting.clone sorting.set(*@session['sort']) return sorting else return @conf.sorting end end |