Module: BlogHelper

Included in:
AuthorsHelper, BaseController, BaseHelper
Defined in:
app/helpers/blog_helper.rb

Instance Method Summary collapse

Instance Method Details

#blog_base_urlObject

The base URL for this request, calculated by looking up the URL for the main blog index page.



4
5
6
# File 'app/helpers/blog_helper.rb', line 4

def blog_base_url
  url_for(controller: '/articles', action: 'index').gsub(%r{/$}, '')
end

#this_blogObject

Find the blog whose base_url matches the current location.



9
10
11
# File 'app/helpers/blog_helper.rb', line 9

def this_blog
  @blog ||= Blog.find_blog(blog_base_url)
end