MS IZ removed the views and redirected the edit route
This commit is contained in:
parent
27f1b29581
commit
24d957cb32
4 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
= @photo.image
|
||||
|
||||
.right
|
||||
= link_to 'Edit Photo', edit_photo_path(@photo), :class => "button"
|
||||
-if current_user.owns? @album
|
||||
= link_to 'Edit Photo', edit_photo_path(@photo), :class => "button"
|
||||
|
||||
.sub_header
|
||||
= link_to "<< prev", url_to_prev(@photo, @album)
|
||||
|
|
|
|||
Loading…
Reference in a new issue