|
Revision 8, 0.5 kB
(checked in by falcon, 18 years ago)
|
|
Tweaks and upgrades, routes/paginate/etc
|
| Rev | Line | |
|---|
| [4] | 1 | class ArtworkController < ApplicationController |
|---|
| 2 | #before_filter :login_required |
|---|
| 3 | layout "main" |
|---|
| 4 | |
|---|
| 5 | def index |
|---|
| 6 | populate_sidebar("Artwork") |
|---|
| 7 | |
|---|
| 8 | respond_to do |format| |
|---|
| 9 | format.html # index.html.erb |
|---|
| 10 | end |
|---|
| 11 | end |
|---|
| 12 | |
|---|
| 13 | def show |
|---|
| 14 | populate_sidebar("Artwork") |
|---|
| [8] | 15 | @gallery = Gallery.find(params[:id]) |
|---|
| 16 | @medias = GalleryMedia.find(:all, :conditions => ["gallery_id = ?", @gallery.id]).paginate(:page => params[:page], :per_page => 1) |
|---|
| [4] | 17 | |
|---|
| 18 | respond_to do |format| |
|---|
| 19 | format.html { |
|---|
| 20 | render :partial => "show_artwork", :layout => "main" |
|---|
| 21 | } |
|---|
| 22 | end |
|---|
| 23 | end |
|---|
| 24 | |
|---|
| 25 | end |
|---|