MS IZ removed the views and redirected the edit route

This commit is contained in:
maxwell 2010-09-13 12:20:47 -07:00
parent 27f1b29581
commit 24d957cb32
4 changed files with 6 additions and 2 deletions

View file

@ -34,6 +34,7 @@ class AlbumsController < ApplicationController
def edit
@album = Album.find_by_id params[:id]
redirect_to @album unless current_user.owns? @album
end
def update

View file

@ -71,6 +71,8 @@ class PhotosController < ApplicationController
def edit
@photo = Photo.find_by_id params[:id]
@album = @photo.album
redirect_to @photo unless current_user.owns? @album
end
def update

View file

@ -6,7 +6,7 @@
%ul#stream
- for post in @posts
= render type_partial(post), :post => post
= render type_partial(post), :post => post unless post.class == Album
#pagination
= will_paginate @posts

View file

@ -21,6 +21,7 @@
= @photo.image
.right
-if current_user.owns? @album
= link_to 'Edit Photo', edit_photo_path(@photo), :class => "button"
.sub_header