Skip to content

Instantly share code, notes, and snippets.

@rrouse
Forked from misutowolf/application_controller.rb
Last active December 28, 2015 14:59
Show Gist options
  • Save rrouse/7518214 to your computer and use it in GitHub Desktop.
Save rrouse/7518214 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :load_config
def load_config
@site = Siteconfig.first
end
end
undefined method `theme' for nil:NilClass
Rails.root: /vagrant/blogplatform
Application Trace | Framework Trace | Full Trace
app/controllers/welcome_controller.rb:3:in `<class:WelcomeController>'
app/controllers/welcome_controller.rb:1:in `<top (required)>'
class WelcomeController < ApplicationController
layout :set_theme_layout
def index
end
def set_theme_layout
"#{@site.theme}/layout/application"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment