changeset 10:56c17679105b

Moar pastes.
author Edho Arief <edho@myconan.net>
date Sun, 26 Aug 2012 11:59:55 -0700
parents 9ba8cf402e06
children c7bdd65f1a1d
files app/controllers/pastes_controller.rb app/views/pastes/show.html.erb
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb	Sun Aug 26 11:59:33 2012 -0700
+++ b/app/controllers/pastes_controller.rb	Sun Aug 26 11:59:55 2012 -0700
@@ -15,6 +15,11 @@
   # GET /pastes/new.json
   def new
     @paste = Paste.new
+    begin
+      @paste.paste = Paste.find(params[:base]).paste
+    rescue
+      nil
+    end
 
     respond_to do |format|
       format.html # new.html.erb
--- a/app/views/pastes/show.html.erb	Sun Aug 26 11:59:33 2012 -0700
+++ b/app/views/pastes/show.html.erb	Sun Aug 26 11:59:55 2012 -0700
@@ -10,4 +10,4 @@
   <%= @paste.paste_hash %>
 </p>
 
-<%= link_to 'Raw', paste_path(@paste, :txt) %>
+<%= link_to 'Raw', paste_path(@paste, :txt) %> | <%= link_to 'New paste based on this', new_paste_path(:base => @paste.id) %> | <%= link_to 'More Paste', new_paste_path %>