Class: EventImportFilesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- EventImportFilesController
- Defined in:
- app/controllers/event_import_files_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /event_import_files POST /event_import_files.xml.
-
#destroy ⇒ Object
DELETE /event_import_files/1 DELETE /event_import_files/1.xml.
-
#edit ⇒ Object
GET /event_import_files/1/edit.
-
#index ⇒ Object
GET /event_import_files GET /event_import_files.xml.
-
#new ⇒ Object
GET /event_import_files/new GET /event_import_files/new.xml.
-
#show ⇒ Object
GET /event_import_files/1 GET /event_import_files/1.xml.
-
#update ⇒ Object
PUT /event_import_files/1 PUT /event_import_files/1.xml.
Instance Method Details
#create ⇒ Object
POST /event_import_files POST /event_import_files.xml
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/controllers/event_import_files_controller.rb', line 54 def create @event_import_file = EventImportFile.new(params[:event_import_file]) @event_import_file.user = current_user respond_to do |format| if @event_import_file.save flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.event_import_file')) format.html { redirect_to(@event_import_file) } format.xml { render :xml => @event_import_file, :status => :created, :location => @event_import_file } else format.html { render :action => "new" } format.xml { render :xml => @event_import_file.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /event_import_files/1 DELETE /event_import_files/1.xml
87 88 89 90 91 92 93 94 |
# File 'app/controllers/event_import_files_controller.rb', line 87 def destroy @event_import_file.destroy respond_to do |format| format.html { redirect_to(event_import_files_url) } format.xml { head :ok } end end |
#edit ⇒ Object
GET /event_import_files/1/edit
49 50 |
# File 'app/controllers/event_import_files_controller.rb', line 49 def edit end |
#index ⇒ Object
GET /event_import_files GET /event_import_files.xml
6 7 8 9 10 11 12 13 |
# File 'app/controllers/event_import_files_controller.rb', line 6 def index @event_import_files = EventImportFile.page(params[:page]) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @event_import_files } end end |
#new ⇒ Object
GET /event_import_files/new GET /event_import_files/new.xml
39 40 41 42 43 44 45 46 |
# File 'app/controllers/event_import_files_controller.rb', line 39 def new @event_import_file = EventImportFile.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @event_import_file } end end |
#show ⇒ Object
GET /event_import_files/1 GET /event_import_files/1.xml
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/event_import_files_controller.rb', line 17 def show if @event_import_file.event_import.path unless configatron.uploaded_file.storage == :s3 file = @event_import_file.event_import.path end end respond_to do |format| format.html # show.html.erb format.xml { render :xml => @event_import_file } format.download { if configatron.uploaded_file.storage == :s3 redirect_to @event_import_file.event_import.expiring_url(10) else send_file file, :filename => @event_import_file.event_import_file_name, :type => 'application/octet-stream' end } end end |
#update ⇒ Object
PUT /event_import_files/1 PUT /event_import_files/1.xml
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'app/controllers/event_import_files_controller.rb', line 72 def update respond_to do |format| if @event_import_file.update_attributes(params[:event_import_file]) flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.event_import_file')) format.html { redirect_to(@event_import_file) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @event_import_file.errors, :status => :unprocessable_entity } end end end |