order by album.title in collection

rails2
Espen Antonsen 2009-11-09 13:54:11 +01:00
parent b65bce12d1
commit 3e39940dfd
2 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ class CollectionsController < ApplicationController
def show
@collection = Collection.find( params[:id] )
@albums = @collection.albums.find(:all, :order => 'title')
respond_to do |format|
format.html
format.json { render :json => @collection }

View File

@ -1,7 +1,7 @@
<h2><%= h @collection.title %></h2>
<p><%= h @collection.description %></p>
<% for album in @collection.albums %>
<% for album in @albums %>
<div class="row">
<div class="title">
<%= render :partial => "photos/thumb", :locals => {:photo => album.photos.first } unless album.photos.empty? %>