From 3ddd936b039474259cff3793c767ecb7f74e89e0 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 11 Apr 2017 16:00:43 -0400 Subject: Refactor exports controller (#1567) * Add basic coverage for settings/exports controller * Remove unused @account variable from settings/exports controller * Add coverage for download export actions * Remove deprecated `render :text` in favor of `send_data` for csv downloads * Add model to handle exports * Use Export class in settings/exports controller * Simplify settings/exports controller methods * Move settings/export to more restful routes --- config/routes.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index 9adcdb862..69f8887b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -53,11 +53,10 @@ Rails.application.routes.draw do resource :preferences, only: [:show, :update] resource :import, only: [:show, :create] - resource :export, only: [:show] do - collection do - get :follows, to: 'exports#download_following_list' - get :blocks, to: 'exports#download_blocking_list' - end + resource :export, only: [:show] + namespace :exports, constraints: { format: :csv } do + resources :follows, only: :index, controller: :following_accounts + resources :blocks, only: :index, controller: :blocked_accounts end resource :two_factor_auth, only: [:show, :new, :create] do -- cgit