Skip to content

Commit

Permalink
include only required assets
Browse files Browse the repository at this point in the history
also add a blank layout for controllers that open inside the lightbox. this allow to not use the application layout which is application wide and will be probably modified.
  • Loading branch information
alepore committed May 30, 2014
1 parent b9a6245 commit 0ec3412
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/controllers/answers_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class AnswersController < ApplicationController
layout 'surveyor_gui_blank'
end
1 change: 1 addition & 0 deletions app/controllers/dependencys_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class DependencysController < ApplicationController
layout 'surveyor_gui_blank'

def new
prep_variables
Expand Down
7 changes: 4 additions & 3 deletions app/controllers/questions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class QuestionsController < ApplicationController
layout 'surveyor_gui_blank'

def new
@title = "Add Question"
Expand All @@ -19,15 +20,15 @@ def edit
@title = "Edit Question"
@question = Question.includes(:answers).find(params[:id])
end

def adjusted_text
if @question.part_of_group?
@question.question_group.text
else
@question.text
end
end

helper_method :adjusted_text

def create
Expand Down Expand Up @@ -115,7 +116,7 @@ def render_answer_fields_partial
end
render :partial => 'answer_fields'
end

def render_grid_partial
if params[:id].blank?
@questions = Question.new
Expand Down
1 change: 1 addition & 0 deletions app/controllers/survey_sections_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class SurveySectionsController < ApplicationController
layout 'surveyor_gui_blank'

def new
@title = "Add Survey Section"
Expand Down
12 changes: 12 additions & 0 deletions app/views/layouts/surveyor_gui_blank.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>SurveyorGui</title>
<%= stylesheet_link_tag "surveyor_gui_all", :media => "all" %>
<%= javascript_include_tag "surveyor_gui_all" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
4 changes: 2 additions & 2 deletions app/views/layouts/surveyor_gui_default.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<html>
<head>
<title>SurveyorGui</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "surveyor_gui_all", :media => "all" %>
<%= javascript_include_tag "surveyor_gui_all" %>
<%= csrf_meta_tags %>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//= require surveyor_all
//= require colorbox-rails
//= require jquery.form
//= require surveyor_gui/jquery.validate
Expand Down

0 comments on commit 0ec3412

Please sign in to comment.