Created
October 29, 2012 17:55
-
-
Save joshuacronemeyer/3975250 to your computer and use it in GitHub Desktop.
Add refinery blog to a rails app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# ...snip... | |
before_filter :check_for_refinery_controller | |
layout :set_layout_for_appname_or_refinery | |
def check_for_refinery_controller | |
@refinery_controller = false | |
my_class_name = self.class.name | |
return if my_class_name.index("::").nil? | |
@refinery_controller = true if my_class_name.split("::").first == "Refinery" | |
end | |
def set_layout_for_appname_or_refinery | |
return "application" if @refinery_controller | |
return "appname" if !@refinery_controller | |
end | |
# ...snip... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gemfile snippet for adding refinery 2.0.8 to rails 3.2.8 app | |
gem 'rails', '3.2.8' | |
#... | |
#refinery dependencies | |
gem 'refinerycms', '2.0.8' | |
gem 'refinerycms-blog', '~> 2.0.0' | |
gem 'will_paginate' | |
#... | |
gem "jquery-rails", "~> 2.0.0" #older version of jquery rails because refinerycms-blog depends on it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#snip... | |
#mount refinery at the cms subdirectory | |
mount Refinery::Core::Engine, :at => '/cms' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment