Class: ReferenceGenomesController

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

Overview

rubocop:todo Style/Documentation

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Methods included from FlashTruncation

#max_flash_size, #truncate_flash, #truncate_flash_array

Instance Method Details

#createObject

POST /reference_genomes POST /reference_genomes.xml


45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/controllers/reference_genomes_controller.rb', line 45

def create
  @reference_genome = ReferenceGenome.new(params[:reference_genome])

  respond_to do |format|
    if @reference_genome.save
      format.html { redirect_to(@reference_genome, notice: 'Reference genome was successfully created.') }
      format.xml { render xml: @reference_genome, status: :created, location: @reference_genome }
    else
      format.html { render action: 'new' }
      format.xml { render xml: @reference_genome.errors, status: :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /reference_genomes/1 DELETE /reference_genomes/1.xml


77
78
79
80
81
82
83
84
85
# File 'app/controllers/reference_genomes_controller.rb', line 77

def destroy
  @reference_genome = ReferenceGenome.find(params[:id])
  @reference_genome.destroy

  respond_to do |format|
    format.html { redirect_to(reference_genomes_url) }
    format.xml { head :ok }
  end
end

#editObject

GET /reference_genomes/1/edit


39
40
41
# File 'app/controllers/reference_genomes_controller.rb', line 39

def edit
  @reference_genome = ReferenceGenome.find(params[:id])
end

#indexObject


8
9
10
11
12
13
14
# File 'app/controllers/reference_genomes_controller.rb', line 8

def index
  @reference_genomes = ReferenceGenome.alphabetical
  respond_to do |format|
    format.html # index.html.erb
    format.xml { render xml: @reference_genomes }
  end
end

#newObject

GET /reference_genomes/new GET /reference_genomes/new.xml


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

def new
  @reference_genome = ReferenceGenome.new

  respond_to do |format|
    format.html # new.html.erb
    format.xml { render xml: @reference_genome }
  end
end

#showObject

GET /reference_genomes/1 GET /reference_genomes/1.xml


18
19
20
21
22
23
24
25
# File 'app/controllers/reference_genomes_controller.rb', line 18

def show
  @reference_genome = ReferenceGenome.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.xml { render xml: @reference_genome }
  end
end

#updateObject

PUT /reference_genomes/1 PUT /reference_genomes/1.xml


61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'app/controllers/reference_genomes_controller.rb', line 61

def update
  @reference_genome = ReferenceGenome.find(params[:id])

  respond_to do |format|
    if @reference_genome.update(params[:reference_genome])
      format.html { redirect_to(@reference_genome, notice: 'Reference genome was successfully updated.') }
      format.xml { head :ok }
    else
      format.html { render action: 'edit' }
      format.xml { render xml: @reference_genome.errors, status: :unprocessable_entity }
    end
  end
end