comparison app/controllers/pastes_controller.rb @ 229:388504e43bcf

Properly return 404 when requesting invalid paste.
author Edho Arief <edho@myconan.net>
date Wed, 15 May 2013 14:10:35 +0900
parents fb9909885d63
children 16251b94eb6c
comparison
equal deleted inserted replaced
228:4a79bc78e90e 229:388504e43bcf
3 3
4 # GET /1 4 # GET /1
5 # GET /1.txt 5 # GET /1.txt
6 def show 6 def show
7 @paste = Paste.safe_find(params[:id]) 7 @paste = Paste.safe_find(params[:id])
8 head :not_found and return unless @paste
8 9
9 expires_in 1.year, :public => true 10 expires_in 1.year, :public => true
10 respond_to do |format| 11 respond_to do |format|
11 format.html # show.html.erb 12 format.html # show.html.erb
12 format.txt # show.txt.erb 13 format.txt # show.txt.erb