Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove attachment action and route

  • Loading branch information...
commit af7373ad884dfad4462e0f58e531921405510f75 1 parent a9b9f05
Jordan Byron jordanbyron authored

Showing 2 changed files with 0 additions and 18 deletions. Show diff stats Hide diff stats

  1. +0 15 app/controllers/puzzles_controller.rb
  2. +0 3  config/routes.rb
15 app/controllers/puzzles_controller.rb
@@ -34,19 +34,4 @@ def show
34 34 end
35 35 end
36 36 end
37   -
38   - def attachments
39   - puzzle = Puzzle.find_by_slug(params[:slug])
40   - # TODO Remove legacy Puzzle#id based routes
41   - puzzle ||= Puzzle.find(params[:slug])
42   -
43   - attachment = Attachment.where("file_name ILIKE ? AND puzzle_id = ?",
44   - [params[:file], params[:format]].compact.join("."), puzzle.id).first
45   -
46   - if attachment
47   - send_data(File.binread(attachment.file_path))
48   - else
49   - raise ActionController::RoutingError.new('Not Found')
50   - end
51   - end
52 37 end
3  config/routes.rb
@@ -6,9 +6,6 @@
6 6 match '/logout' => 'sessions#destroy', :as => 'logout'
7 7 match '/login' => 'sessions#new', :as => 'login'
8 8
9   - match '/puzzles/:slug/attachments/:file', :to => 'puzzles#attachments',
10   - :as => "attachment"
11   -
12 9 resources :puzzles do
13 10 resources :comments, :controller => "Puzzles::Comments"
14 11 resources :submissions, :controller => "Puzzles::Submissions"

0 comments on commit af7373a

Please sign in to comment.
Something went wrong with that request. Please try again.