mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-28 17:54:16 +08:00
fixed controllers
This commit is contained in:
parent
bb9c03df24
commit
3117a464f0
6 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
class MyModulesController < ApplicationController
|
||||
include SampleActions
|
||||
include OrganizationsHelper
|
||||
|
||||
before_action :load_vars, only: [
|
||||
:show, :edit, :update, :destroy,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
class SampleMyModulesController < ApplicationController
|
||||
include OrganizationsHelper
|
||||
before_action :load_vars
|
||||
|
||||
def index
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue