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:
parent
6b26a58497
commit
60f00e33be
@ -3,11 +3,11 @@ class CategoriesController < ApplicationController
|
||||
# GET /categories
|
||||
# GET /categories.xml
|
||||
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
|
||||
|
||||
@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|
|
||||
format.html # index.html.erb
|
||||
|
||||
@ -2,7 +2,7 @@ class PagesController < ApplicationController
|
||||
layout "photos"
|
||||
|
||||
def index
|
||||
@photo = Photo.first(:order => 'RANDOM()', :conditions => { :featured => true, :enabled => true })
|
||||
@photo = Photo.where(:featured => true).where(:enabled => true).order('RANDOM()').first
|
||||
end
|
||||
|
||||
def about
|
||||
|
||||
@ -7,7 +7,7 @@ class PhotosController < ApplicationController
|
||||
def index
|
||||
if 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
|
||||
else
|
||||
@photos = Photo.paginate :all, :page => params[:page], :per_page => 11
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Photos</title>
|
||||
<title>Dan Barber Photography</title>
|
||||
<meta http-equiv="Content-Type" content="text/html" />
|
||||
<meta name="keywords" content="photography, images, landscapes" />
|
||||
<meta name="description" content="The photography portfolio of Dan Barber" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user