Class: EasyReports::DatabasesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/easy_reports/databases_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
# File 'app/controllers/easy_reports/databases_controller.rb', line 21

def create
  @database = Database.new(database_params)

  if @database.save
    redirect_to @database, notice: 'Database was successfully created.'
  else
    render :new
  end
end

#destroyObject



39
40
41
42
# File 'app/controllers/easy_reports/databases_controller.rb', line 39

def destroy
  @database.destroy
  redirect_to databases_url, notice: 'Database was successfully destroyed.'
end

#editObject



18
19
# File 'app/controllers/easy_reports/databases_controller.rb', line 18

def edit
end

#indexObject



7
8
9
# File 'app/controllers/easy_reports/databases_controller.rb', line 7

def index
  @databases = Database.all
end

#newObject



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

def new
  @database = Database.new
end

#showObject



11
12
# File 'app/controllers/easy_reports/databases_controller.rb', line 11

def show
end

#updateObject



31
32
33
34
35
36
37
# File 'app/controllers/easy_reports/databases_controller.rb', line 31

def update
  if @database.update(database_params)
    redirect_to @database, notice: 'Database was successfully updated.'
  else
    render :edit
  end
end