2016-02-12 23:52:43 +08:00
|
|
|
class SampleMyModulesController < ApplicationController
|
2017-01-25 00:06:51 +08:00
|
|
|
include TeamsHelper
|
2016-02-12 23:52:43 +08:00
|
|
|
before_action :load_vars
|
|
|
|
|
|
|
|
def index
|
|
|
|
@number_of_samples = @my_module.number_of_samples
|
2016-10-13 16:00:36 +08:00
|
|
|
@samples = @my_module.first_n_samples
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2017-01-24 23:57:14 +08:00
|
|
|
current_team_switch(@my_module
|
2016-10-11 22:46:30 +08:00
|
|
|
.experiment
|
|
|
|
.project
|
2017-01-24 23:57:14 +08:00
|
|
|
.team)
|
2016-02-12 23:52:43 +08:00
|
|
|
respond_to do |format|
|
|
|
|
format.json {
|
|
|
|
render :json => {
|
|
|
|
:html => render_to_string({
|
|
|
|
:partial => "index.html.erb"
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def load_vars
|
|
|
|
@my_module = MyModule.find_by_id(params[:my_module_id])
|
|
|
|
|
|
|
|
unless @my_module
|
|
|
|
render_404
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|