Class: TinOpener::DataSetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tin_opener/data_sets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 19

def create
  @data_set = DataSet.new(data_set_params)

  if @data_set.save
    redirect_to @data_set, notice: 'Data set was successfully created.'
  else
    @data_sets = DataSet.all
    render :index
  end
end

#destroyObject



38
39
40
41
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 38

def destroy
  @data_set.destroy
  redirect_to data_sets_url, notice: 'Data set was successfully destroyed.'
end

#editObject



16
17
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 16

def edit
end

#indexObject



7
8
9
10
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 7

def index
  @data_sets = DataSet.all
  @data_set  = DataSet.new
end

#showObject



12
13
14
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 12

def show
  @records = @data_set.records
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/tin_opener/data_sets_controller.rb', line 30

def update
  if @data_set.update(data_set_params)
    redirect_to @data_set, notice: 'Data set was successfully updated.'
  else
    render :edit
  end
end