class CheckByNormal
this class provides the funcationality of listing all the products available for that particular store
Public Class Methods
new(param)
click to toggle source
this method initializes base class object with the store detail
Calls superclass method
BasicWay::new
# File lib/product_home_template.rb, line 90 def initialize(param) super(param) end
Public Instance Methods
my_special_method(pages)
click to toggle source
this method to run the logic of listing the products with pagination
# File lib/product_home_template.rb, line 95 def my_special_method(pages) @products = @store_detail.products.order('id asc').paginate(page: pages, per_page: 3) puts("=== by baisc page ===") return @products end
my_special_method_without(member)
click to toggle source
this method to run the logic of listing the products without pagination
# File lib/product_home_template.rb, line 102 def my_special_method_without(member) @products = @store_detail.products.order('id asc') return @products end