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
# 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
    render :new
  end
end

#destroyObject



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

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



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

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