Class: DailyTablesController

Inherits:
InheritedResources::Base
  • Object
show all
Defined in:
app/controllers/daily_tables_controller.rb

Instance Method Summary collapse

Instance Method Details

#archiveitObject



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

#createObject



9
10
11
12
# File 'app/controllers/daily_tables_controller.rb', line 9

def create
  build_resource.user = current_user
  create!
end

#destroyObject



42
43
44
# File 'app/controllers/daily_tables_controller.rb', line 42

def destroy
  destroy! { user_root_path }
end

#newObject



4
5
6
7
# File 'app/controllers/daily_tables_controller.rb', line 4

def new
  build_resource.metric = "SqlQuery"
  new!
end

#showObject



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

#unarchiveitObject



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

#updateObject



14
15
16
# File 'app/controllers/daily_tables_controller.rb', line 14

def update
  update!
end