Class: EasyReports::ReportsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- EasyReports::ReportsController
- Defined in:
- app/controllers/easy_reports/reports_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 18 def create @report_form = ReportForm.new(report_params) if @report_form.save redirect_to @report_form, notice: 'Report was successfully created.' else render :new end end |
#destroy ⇒ Object
43 44 45 46 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 43 def destroy @report.destroy redirect_to reports_url, notice: 'Report was successfully destroyed.' end |
#edit ⇒ Object
32 33 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 32 def edit end |
#index ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 7 def index @reports = Report.all database_mediator = EasyReports::DatabaseMediator.new @table_list = database_mediator.tables end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 14 def new @report_form = ReportForm.new end |
#show ⇒ Object
29 30 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 29 def show end |
#update ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 35 def update if @report.update(report_params) redirect_to @report, notice: 'Report was successfully updated.' else render :edit end end |