Class: ReferenceGenomesController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

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

Instance Method Details

#createObject

POST /reference_genomes POST /reference_genomes.xml


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

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


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

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


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

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

#indexObject


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

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


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

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


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

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


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

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