Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove attachment action and route

  • Loading branch information...
commit af7373ad884dfad4462e0f58e531921405510f75 1 parent a9b9f05
@jordanbyron jordanbyron authored
Showing with 0 additions and 18 deletions.
  1. +0 −15 app/controllers/puzzles_controller.rb
  2. +0 −3  config/routes.rb
View
15 app/controllers/puzzles_controller.rb
@@ -34,19 +34,4 @@ def show
end
end
end
-
- def attachments
- puzzle = Puzzle.find_by_slug(params[:slug])
- # TODO Remove legacy Puzzle#id based routes
- puzzle ||= Puzzle.find(params[:slug])
-
- attachment = Attachment.where("file_name ILIKE ? AND puzzle_id = ?",
- [params[:file], params[:format]].compact.join("."), puzzle.id).first
-
- if attachment
- send_data(File.binread(attachment.file_path))
- else
- raise ActionController::RoutingError.new('Not Found')
- end
- end
end
View
3  config/routes.rb
@@ -6,9 +6,6 @@
match '/logout' => 'sessions#destroy', :as => 'logout'
match '/login' => 'sessions#new', :as => 'login'
- match '/puzzles/:slug/attachments/:file', :to => 'puzzles#attachments',
- :as => "attachment"
-
resources :puzzles do
resources :comments, :controller => "Puzzles::Comments"
resources :submissions, :controller => "Puzzles::Submissions"
Please sign in to comment.
Something went wrong with that request. Please try again.