fixed layout

This commit is contained in:
zmagod 2016-07-28 11:00:56 +02:00
parent d16c0fe706
commit c11932b45b
3 changed files with 10 additions and 3 deletions

View file

@ -1,8 +1,8 @@
class CanvasController < ApplicationController
before_action :load_vars
# before_action :check_view_canvas, only: [:edit, :full_zoom, :medium_zoom, :small_zoom]
# before_action :check_edit_canvas, only: [:edit, :update]
before_action :check_view_canvas, only: [:edit, :full_zoom, :medium_zoom, :small_zoom]
before_action :check_edit_canvas, only: [:edit, :update]
def edit
render partial: 'canvas/edit',

View file

@ -3,6 +3,9 @@ class ExperimentsController < ApplicationController
before_action :set_experiment, except: [:new, :create]
before_action :set_project, only: [:new, :create]
# except parameter could be used but it is not working.
layout :choose_layout
def new
@experiment = Experiment.new
end
@ -68,4 +71,8 @@ class ExperimentsController < ApplicationController
def experiment_params
params.require(:experiment).permit(:name, :description, :archived)
end
def choose_layout
action_name.in?(['index', 'archive']) ? 'main' : 'fluid'
end
end

View file

@ -1,4 +1,4 @@
<% content_for :sidebar do %>
<%= content_for :sidebar do %>
<div id="slide-panel" class="visible">
<div class="sidebar-header">