diff 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
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb	Thu Oct 04 04:23:39 2012 +0700
+++ b/app/controllers/pastes_controller.rb	Thu Oct 04 04:36:49 2012 +0700
@@ -3,6 +3,11 @@
   # GET /pastes/1
   # GET /pastes/1.json
   def show
+    id = params[:id].to_i
+    if id.to_s != params[:id]
+      redirect_to paste_path(id)
+      return
+    end
     @paste = Paste.find(params[:id])
 
     respond_to do |format|