diff options
author | John Agan <johnagan@gmail.com> | 2012-07-31 00:07:49 -0400 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2012-09-05 12:54:09 +1200 |
commit | 6cc795274d9d1de415951dd6d8e1c0d1c99e237c (patch) | |
tree | 73bacac23df00f68bbf2516339121cd7ec9579f3 | |
parent | b81af5b599d3535ffded519588a055a52fb80193 (diff) | |
download | refinerycms-blog-6cc795274d9d1de415951dd6d8e1c0d1c99e237c.tar.gz refinerycms-blog-6cc795274d9d1de415951dd6d8e1c0d1c99e237c.tar.bz2 refinerycms-blog-6cc795274d9d1de415951dd6d8e1c0d1c99e237c.zip |
Added the ability to use a different url than "/blog"
-rw-r--r-- | app/controllers/refinery/blog/blog_controller.rb | 2 | ||||
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb | 2 | ||||
-rw-r--r-- | lib/refinery/blog/configuration.rb | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/refinery/blog/blog_controller.rb b/app/controllers/refinery/blog/blog_controller.rb index 54a8b03..6327199 100644 --- a/app/controllers/refinery/blog/blog_controller.rb +++ b/app/controllers/refinery/blog/blog_controller.rb @@ -10,7 +10,7 @@ module Refinery protected def find_page - @page = Refinery::Page.find_by_link_url("/blog") + @page = Refinery::Page.find_by_link_url(Refinery::Blog.page_url) end end end diff --git a/config/routes.rb b/config/routes.rb index ad8d138..f3467bd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Refinery::Core::Engine.routes.draw do - namespace :blog do + namespace :blog, :path => Refinery::Blog.page_url do root :to => "posts#index" resources :posts, :only => [:show] @@ -12,7 +12,7 @@ Refinery::Core::Engine.routes.draw do namespace :blog, :path => '' do namespace :admin, :path => 'refinery' do - scope :path => 'blog' do + scope :path => Refinery::Blog.page_url do root :to => "posts#index" resources :posts do diff --git a/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb index ac340d7..294c258 100644 --- a/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb +++ b/lib/generators/refinery/blog/templates/config/initializers/refinery/blog.rb.erb @@ -8,4 +8,6 @@ Refinery::Blog.configure do |config| # config.post_teaser_length = <%= Refinery::Blog.post_teaser_length.inspect %> # config.share_this_key = <%= Refinery::Blog.share_this_key.inspect %> + + # config.page_url = <%= Refinery::Blog.page_url.inspect %> end diff --git a/lib/refinery/blog/configuration.rb b/lib/refinery/blog/configuration.rb index 0f00501..b7598e8 100644 --- a/lib/refinery/blog/configuration.rb +++ b/lib/refinery/blog/configuration.rb @@ -3,12 +3,13 @@ module Refinery include ActiveSupport::Configurable config_accessor :validate_source_url, :comments_per_page, :posts_per_page, - :post_teaser_length, :share_this_key + :post_teaser_length, :share_this_key, :page_url self.validate_source_url = false self.comments_per_page = 10 self.posts_per_page = 10 self.post_teaser_length = 250 self.share_this_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" + self.page_url = "/blog" end end |