using id in params
This commit is contained in:
parent
dde62b43d4
commit
5f16fa8948
4 changed files with 6 additions and 4 deletions
|
@ -27,7 +27,7 @@ class AlbumsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@album = Album.find_by_title( params[:id])
|
||||
@album = Album.find( params[:id])
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render :json => @album }
|
||||
|
|
|
@ -12,7 +12,7 @@ class CollectionsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@collection = Collection.find_by_title( params[:id] )
|
||||
@collection = Collection.find( params[:id] )
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render :json => @collection }
|
||||
|
|
|
@ -16,7 +16,8 @@ class Album < ActiveRecord::Base
|
|||
named_scope :untouched, :conditions => "Albums.Id IN ( SELECT DISTINCT Photos.Album_Id FROM Photos WHERE Photos.description IS NULL AND Photos.Id NOT IN ( SELECT Photo_ID FROM Photo_Tags) )"
|
||||
|
||||
def to_param
|
||||
title.gsub(/[^a-z0-9]+/i, '-')
|
||||
"#{id}-#{title.parameterize}"
|
||||
#self.title.gsub(/[^a-z0-9]+/i, '-')
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ class Collection < ActiveRecord::Base
|
|||
attr_accessor :album_list
|
||||
|
||||
def to_param
|
||||
title.gsub(/[^a-z0-9]+/i, '-')
|
||||
#title.gsub(/[^a-z0-9]+/i, '-')
|
||||
"#{id}-#{title.parameterize}"
|
||||
end
|
||||
|
||||
def album_list=(albums)
|
||||
|
|
Loading…
Reference in a new issue