Module: Xport::DownloadsControllerMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/xport/downloads_controller_methods.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
35 36 37 38 |
# File 'lib/xport/downloads_controller_methods.rb', line 35 def destroy @download.destroy redirect_to action: 'index' end |
#index ⇒ Object
12 |
# File 'lib/xport/downloads_controller_methods.rb', line 12 def index; end |
#show ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/xport/downloads_controller_methods.rb', line 14 def show respond_to do |format| format.html do if !request.xhr? && @download.file? redirect_to format: @download.type else render 'show' end end format.any(:xlsx, :csv) do send_data @download.file.read, filename: @download.filename end end end |
#update ⇒ Object
30 31 32 33 |
# File 'lib/xport/downloads_controller_methods.rb', line 30 def update @download.schedule_export! redirect_to @download end |