class Basepack::Forms::List
Attributes
query_form[R]
Public Class Methods
new(factory, chain, options = {})
click to toggle source
Calls superclass method
Basepack::Forms::Base::new
# File lib/basepack/forms/list.rb, line 6 def initialize(factory, chain, options = {}) super(factory, chain, options) @query_form = options[:query_form] end
Public Instance Methods
collection()
click to toggle source
# File lib/basepack/forms/list.rb, line 21 def collection @query_form ? @query_form.collection : [] end
collection_each(&block)
click to toggle source
# File lib/basepack/forms/list.rb, line 25 def collection_each(&block) collection.each_with_index do |res, i| with_resource(res, res, i, &block) end end
collection_without_pagination()
click to toggle source
# File lib/basepack/forms/list.rb, line 31 def collection_without_pagination collection.offset(nil).limit(nil) end
partial()
click to toggle source
# File lib/basepack/forms/list.rb, line 16 def partial section = factory.section Basepack::Utils.model_config(resource_class).send(section).partial end
view=(view)
click to toggle source
Calls superclass method
# File lib/basepack/forms/list.rb, line 11 def view=(view) super @query_form.view = view if @query_form end