Skip to content

Instantly share code, notes, and snippets.

@dummied
Created May 1, 2009 14:41
Show Gist options
  • Save dummied/105070 to your computer and use it in GitHub Desktop.
Save dummied/105070 to your computer and use it in GitHub Desktop.
# 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