# HG changeset patch # User Edho Arief # Date 1346006347 25200 # Node ID 3a1f6c2e195d9bc11aa279dcbaa46e76f449e802 # Parent 5e54b5ff78d0aea773c34c0fac17295e3b4cf08a Added raw paste view. diff -r 5e54b5ff78d0 -r 3a1f6c2e195d app/controllers/pastes_controller.rb --- a/app/controllers/pastes_controller.rb Sun Aug 26 11:37:49 2012 -0700 +++ b/app/controllers/pastes_controller.rb Sun Aug 26 11:39:07 2012 -0700 @@ -6,6 +6,7 @@ respond_to do |format| format.html # show.html.erb + format.txt # show.html.erb format.json { render :json => @paste } end end diff -r 5e54b5ff78d0 -r 3a1f6c2e195d app/views/pastes/show.html.erb --- a/app/views/pastes/show.html.erb Sun Aug 26 11:37:49 2012 -0700 +++ b/app/views/pastes/show.html.erb Sun Aug 26 11:39:07 2012 -0700 @@ -9,3 +9,5 @@ Hash: <%= @paste.paste_hash %>

+ +<%= link_to 'Raw', paste_path(@paste, :txt) %> diff -r 5e54b5ff78d0 -r 3a1f6c2e195d config/initializers/mime_types.rb --- a/config/initializers/mime_types.rb Sun Aug 26 11:37:49 2012 -0700 +++ b/config/initializers/mime_types.rb Sun Aug 26 11:39:07 2012 -0700 @@ -3,3 +3,4 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone +Mime::Type.register "text/plain", :txt