Class: Studies::SamplesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/studies/samples_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject


6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/studies/samples_controller.rb', line 6

def index
  @study = Study.find(params[:study_id])
  @samples = @study.samples.order(:created_at)

  respond_to do |format|
    format.html
    format.json { render json: @samples.to_json }
    format.xml  { render xml: @samples.to_xml }
  end
end