Module: BlogHelper

Included in:
AuthorsHelper, BaseController, BaseHelper, Users::RegistrationsController
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.



6
7
8
# File 'app/helpers/blog_helper.rb', line 6

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.



11
12
13
# File 'app/helpers/blog_helper.rb', line 11

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