Mercurial > zeropaste
comparison app/controllers/pastes_controller.rb @ 49:c09020fc73f5
Empty rescue instead of random nil.
| author | Edho Arief <edho@myconan.net> |
|---|---|
| date | Thu, 04 Oct 2012 03:08:00 +0700 |
| parents | f649b46fca4f |
| children | 817c54a72b58 |
comparison
equal
deleted
inserted
replaced
| 48:f649b46fca4f | 49:c09020fc73f5 |
|---|---|
| 16 def new | 16 def new |
| 17 @paste = Paste.new | 17 @paste = Paste.new |
| 18 begin | 18 begin |
| 19 @paste.paste = Paste.find(params[:base]).paste | 19 @paste.paste = Paste.find(params[:base]).paste |
| 20 rescue | 20 rescue |
| 21 nil | |
| 22 end | 21 end |
| 23 | 22 |
| 24 respond_to do |format| | 23 respond_to do |format| |
| 25 format.html # new.html.erb | 24 format.html # new.html.erb |
| 26 format.json { render :json => @paste } | 25 format.json { render :json => @paste } |
