Class: SesDashboard::EmailsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SesDashboard::EmailsController
- Defined in:
- app/controllers/ses_dashboard/emails_controller.rb
Instance Method Summary collapse
Instance Method Details
#export ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/ses_dashboard/emails_controller.rb', line 22 def export scope = filtered_scope respond_to do |format| format.csv do send_data generate_csv(scope), filename: "emails-#{Date.today}.csv", type: "text/csv" end format.json do send_data serialize_emails(scope).to_json, filename: "emails-#{Date.today}.json", type: "application/json" end end end |
#index ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/ses_dashboard/emails_controller.rb', line 7 def index scope = filtered_scope @emails, @pagination = Paginatable.paginate(scope, page: params[:page]) respond_to do |format| format.html format.json { render json: serialize_emails(@emails) } end end |
#show ⇒ Object
17 18 19 20 |
# File 'app/controllers/ses_dashboard/emails_controller.rb', line 17 def show @email = @project.emails.find(params[:id]) @events = @email.email_events.ordered end |