Mercurial > zeropaste
comparison app/controllers/pastes_controller.rb @ 53:817c54a72b58
Minor sanitation.
| author | Edho Arief <edho@myconan.net> | 
|---|---|
| date | Thu, 04 Oct 2012 04:36:49 +0700 | 
| parents | c09020fc73f5 | 
| children | f7b7a39fb48c | 
   comparison
  equal
  deleted
  inserted
  replaced
| 52:4c782f8d835b | 53:817c54a72b58 | 
|---|---|
| 1 class PastesController < ApplicationController | 1 class PastesController < ApplicationController | 
| 2 caches_page :show | 2 caches_page :show | 
| 3 # GET /pastes/1 | 3 # GET /pastes/1 | 
| 4 # GET /pastes/1.json | 4 # GET /pastes/1.json | 
| 5 def show | 5 def show | 
| 6 id = params[:id].to_i | |
| 7 if id.to_s != params[:id] | |
| 8 redirect_to paste_path(id) | |
| 9 return | |
| 10 end | |
| 6 @paste = Paste.find(params[:id]) | 11 @paste = Paste.find(params[:id]) | 
| 7 | 12 | 
| 8 respond_to do |format| | 13 respond_to do |format| | 
| 9 format.html # show.html.erb | 14 format.html # show.html.erb | 
| 10 format.txt # show.html.erb | 15 format.txt # show.html.erb | 
