Skip to content
Extraits de code Groupes Projets
Valider 24d957cb rédigé par maxwell's avatar maxwell
Parcourir les fichiers

MS IZ removed the views and redirected the edit route

parent 27f1b295
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter