1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Altered page title and adjusted categories so they sort on "sort"

column.
This commit is contained in:
Dan Barber 2010-12-14 10:38:57 -05:00
parent 6b26a58497
commit 60f00e33be
4 changed files with 5 additions and 5 deletions

View File

@ -3,11 +3,11 @@ class CategoriesController < ApplicationController
# GET /categories # GET /categories
# GET /categories.xml # GET /categories.xml
def index def index
@categories = Category.paginate :all, :page => params[:page], :per_page => 4 @categories = Category.order('sort ASC').paginate :all, :page => params[:page], :per_page => 4
@num_categories = @categories.count @num_categories = @categories.count
@photos = Photo.all(:limit => 2, :order => 'RANDOM()', :conditions => { :featured => true, :enabled => true }) @photos = Photo.where(:enabled => true).where(:featured => true).limit(2).order('RANDOM()')
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb

View File

@ -2,7 +2,7 @@ class PagesController < ApplicationController
layout "photos" layout "photos"
def index def index
@photo = Photo.first(:order => 'RANDOM()', :conditions => { :featured => true, :enabled => true }) @photo = Photo.where(:featured => true).where(:enabled => true).order('RANDOM()').first
end end
def about def about

View File

@ -7,7 +7,7 @@ class PhotosController < ApplicationController
def index def index
if params[:category_id] if params[:category_id]
@category = Category.find_by_id(params[:category_id]) @category = Category.find_by_id(params[:category_id])
@photos = @category.photos.paginate :page => params[:page], :conditions => { :enabled => true }, :per_page => 11 @photos = @category.photos.where(:enabled => true).paginate(:page => params[:page], :per_page => 11)
@num_photos = @photos.count @num_photos = @photos.count
else else
@photos = Photo.paginate :all, :page => params[:page], :per_page => 11 @photos = Photo.paginate :all, :page => params[:page], :per_page => 11

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<title>Photos</title> <title>Dan Barber Photography</title>
<meta http-equiv="Content-Type" content="text/html" /> <meta http-equiv="Content-Type" content="text/html" />
<meta name="keywords" content="photography, images, landscapes" /> <meta name="keywords" content="photography, images, landscapes" />
<meta name="description" content="The photography portfolio of Dan Barber" /> <meta name="description" content="The photography portfolio of Dan Barber" />