1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00
danbarberphoto/app/controllers/categories_controller.rb
2018-02-16 11:10:13 -05:00

20 lines
427 B
Ruby

class CategoriesController < ApplicationController
# GET /categories
# GET /categories.xml
def index
@categories = Category.order("sort ASC").page(params[:page]).per(4)
@photos = Photo.featured.limit(2).order("RANDOM()")
@page_title = "Portfolio"
@num_blank = 4 - @categories.length
end
# GET /categories/1
# GET /categories/1.xml
def show
@category = Category.find(params[:id])
end
end