updated so tag listing works. find_by_title instead of id
This commit is contained in:
parent
dfd2cf079c
commit
7c48fa7a09
|
@ -5,9 +5,9 @@ class PhotosController < ApplicationController
|
|||
|
||||
def index
|
||||
if params[:tag_id] && params[:album_id]
|
||||
@photos = Tag.find( params[:tag_id] ).photos.find(:all, :conditions => ['photos.album_id = :album', {:album => Album.find(params[:album_id] ) } ], :order => "photos.id ASC")
|
||||
@photos = Tag.find_by_title( params[:tag_id] ).photos.find(:all, :conditions => ['photos.album_id = :album', {:album => Album.find(params[:album_id] ) } ], :order => "photos.id ASC")
|
||||
elsif params[:tag_id]
|
||||
@photos = Tag.find( params[:tag_id] ).photos.find(:all, :order => "photos.id ASC")
|
||||
@photos = Tag.find_by_title( params[:tag_id] ).photos.find(:all, :order => "photos.id ASC")
|
||||
elsif params[:album_id]
|
||||
@photos = Album.find( params[:album_id]).photos.find(:all, :order => "photos.id ASC")
|
||||
elsif params[:q]
|
||||
|
|
|
@ -8,7 +8,7 @@ module ApplicationHelper
|
|||
#links = "You are here: "
|
||||
links = content_tag('a', "HOME", :href => "/") if include_home
|
||||
|
||||
nocrumb = ["collections", "albums", "photos", "tags", "new", "edit"]
|
||||
nocrumb = ["collections", "albums", "photos", "tags", "new", "edit", "tags"]
|
||||
|
||||
levels.each_with_index do |level, index|
|
||||
level = level.gsub(/^[0-9]+\-/,"") #if levels[index-1] == "photos"
|
||||
|
|
|
@ -11,7 +11,7 @@ class Tag < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def to_param
|
||||
"#{id}-#{title.parameterize}"
|
||||
title.parameterize
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
Loading…
Reference in a new issue