Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created April 2, 2009 00:12
Show Gist options
  • Save sprite2005/88962 to your computer and use it in GitHub Desktop.
Save sprite2005/88962 to your computer and use it in GitHub Desktop.
def show
@photo = Photo.find(params[:id])
@user = @photo.user
@album = @photo.album
@is_current_user = @user.eql?(current_user)
@comment = Comment.new(params[:comment])
@previous = @photo.previous_photo
@next = @photo.next_photo
@related = Photo.find_related_to(@photo)
respond_to do |format|
format.html # show.rhtml
end
rescue ActiveRecord::RecordNotFound
flash[:error] = "The picture was not found."
redirect_to :controller => 'base', :action => 'site_index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment