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
24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 24 def create @report = Report.new(report_params) if @report.save redirect_to @report, notice: 'Report was successfully created.' else render :new end end |
#destroy ⇒ Object
42 43 44 45 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 42 def destroy @report.destroy redirect_to reports_url, notice: 'Report was successfully destroyed.' end |
#edit ⇒ Object
21 22 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 21 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
17 18 19 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 17 def new @report = Report.new end |
#show ⇒ Object
14 15 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 14 def show end |
#update ⇒ Object
34 35 36 37 38 39 40 |
# File 'app/controllers/easy_reports/reports_controller.rb', line 34 def update if @report.update(report_params) redirect_to @report, notice: 'Report was successfully updated.' else render :edit end end |