Mercurial > zeropaste
comparison app/controllers/pastes_controller.rb @ 181:500c09718fd7
Added fresh paste marker.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Fri, 01 Feb 2013 22:58:53 +0700 |
parents | db5164ff73a9 |
children | fc234f8cf3d9 |
comparison
equal
deleted
inserted
replaced
180:dd5a154c17c7 | 181:500c09718fd7 |
---|---|
50 end | 50 end |
51 | 51 |
52 begin | 52 begin |
53 respond_to do |format| | 53 respond_to do |format| |
54 if @paste.save | 54 if @paste.save |
55 @fresh = true | |
55 format.html { redirect_to @paste, :notice => 'Paste was successfully created.' } | 56 format.html { redirect_to @paste, :notice => 'Paste was successfully created.' } |
56 format.json { render :json => @paste, :status => :created, :location => @paste } | 57 format.json { render :json => @paste, :status => :created, :location => @paste } |
57 else | 58 else |
58 format.html { render :action => "new" } | 59 format.html { render :action => "new" } |
59 format.json { render :json => @paste.errors, :status => :unprocessable_entity } | 60 format.json { render :json => @paste.errors, :status => :unprocessable_entity } |