class Website::ServicesController
Public Instance Methods
filter()
click to toggle source
# File lib/generators/sbidu_generators/website_templates/app/controllers/website/services_controller.rb, line 11 def filter @categories = Dhatu::Category.published.where(category_type: "Dhatu::Service").order("priority ASC, name ASC").all @services_banner = Dhatu::Section.find_by_section_type("SERVICES_BANNER").published.first @category = Dhatu::Category.find_by_permalink(params[:category_id]) @services = Dhatu::Service.published.where("category_id = ?", @category.try(:id)).order("priority ASC, name ASC").all render :index end
index()
click to toggle source
# File lib/generators/sbidu_generators/website_templates/app/controllers/website/services_controller.rb, line 5 def index @categories = Dhatu::Category.published.where(category_type: "Dhatu::Service").order("priority ASC, name ASC").all @services_banner = Dhatu::Section.find_by_section_type("SERVICES_BANNER").published.first @services = Dhatu::Service.published.order("priority ASC, name ASC").all end
show()
click to toggle source
# File lib/generators/sbidu_generators/website_templates/app/controllers/website/services_controller.rb, line 19 def show @categories = Dhatu::Category.where(category_type: "Dhatu::Service").order("priority ASC, name ASC").all @services_banner = Dhatu::Section.find_by_section_type("SERVICES_BANNER").published.first @service = Dhatu::Service.find_by_id(params[:id]) @services = Dhatu::Service.published.where("category_id = ?", @service.category_id).order("priority ASC, name ASC").all end