Created
May 1, 2009 14:41
-
-
Save dummied/105070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Displays the 21 most-recent galleries. | |
def index | |
@galleries = Gallery.paginate( | |
:order => "galleries.created_at DESC", | |
:include => [:sitings], | |
:conditions => "sitings.site_id = 1 and status not in ('hidden', 'deactivated')", | |
:page => page, | |
:per_page => 21 | |
) | |
@title = "Galleries" | |
respond_to do |format| | |
format.html { render :layout => "#{template}_fullpage", :action => "list" } | |
format.txt { render :action => "list" } | |
format.js { | |
render :json => @galleries.to_json | |
} | |
format.xml { | |
render :xml => @galleries.to_xml | |
} | |
format.atom { | |
render :layout => false, :action => "list" | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment