fixed controllers

This commit is contained in:
zmagod 2016-10-12 09:30:55 +02:00
parent bb9c03df24
commit 3117a464f0
6 changed files with 10 additions and 2 deletions

View file

@ -1,7 +1,7 @@
class ExperimentsController < ApplicationController
include PermissionHelper
include OrganizationsHelper
before_action :set_experiment,
except: [:new, :create]
before_action :set_project,

View file

@ -1,5 +1,6 @@
class MyModulesController < ApplicationController
include SampleActions
include OrganizationsHelper
before_action :load_vars, only: [
:show, :edit, :update, :destroy,

View file

@ -24,6 +24,11 @@ class ProjectsController < ApplicationController
DELETE_SAMPLES = I18n.t("samples.delete_samples")
def index
if params[:organization]
current_organization_switch(Organization
.find_by_id(params[:organization]))
end
@current_organization_id = current_organization.id
@current_sort = params[:sort].to_s
@projects_by_orgs = current_user.projects_by_orgs(@current_organization_id,

View file

@ -1,4 +1,5 @@
class ReportsController < ApplicationController
include OrganizationsHelper
# Ignore CSRF protection just for PDF generation (because it's
# used via target='_blank')
protect_from_forgery with: :exception, :except => :generate

View file

@ -1,4 +1,5 @@
class SampleMyModulesController < ApplicationController
include OrganizationsHelper
before_action :load_vars
def index

View file

@ -279,7 +279,7 @@ class SamplesController < ApplicationController
def load_vars
@sample = Sample.find_by_id(params[:id])
@organization = @sample.organization
@organization = current_organization
unless @sample
render_404