Class: DailyTablesController
- Inherits:
-
InheritedResources::Base
- Object
- InheritedResources::Base
- DailyTablesController
- Defined in:
- app/controllers/daily_tables_controller.rb
Instance Method Summary collapse
- #archiveit ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #unarchiveit ⇒ Object
- #update ⇒ Object
Instance Method Details
#archiveit ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/controllers/daily_tables_controller.rb', line 24 def archiveit if @daily_table.archive flash[:notice] = "Table has been archived." else flash[:alert] = "Table has not been archived." end redirect_to @daily_table end |
#create ⇒ Object
9 10 11 12 |
# File 'app/controllers/daily_tables_controller.rb', line 9 def create build_resource.user = current_user create! end |
#destroy ⇒ Object
42 43 44 |
# File 'app/controllers/daily_tables_controller.rb', line 42 def destroy destroy! { user_root_path } end |
#new ⇒ Object
4 5 6 7 |
# File 'app/controllers/daily_tables_controller.rb', line 4 def new build_resource.metric = "SqlQuery" new! end |
#show ⇒ Object
18 19 20 21 22 |
# File 'app/controllers/daily_tables_controller.rb', line 18 def show show! do @test_html = @daily_table.test if params[:test] end end |
#unarchiveit ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/controllers/daily_tables_controller.rb', line 33 def unarchiveit if @daily_table.unarchive flash[:notice] = "Table has been unarchived." else flash[:alert] = "Table has not been unarchived." end redirect_to @daily_table end |
#update ⇒ Object
14 15 16 |
# File 'app/controllers/daily_tables_controller.rb', line 14 def update update! end |