class Seorel::Helper::Base
Attributes
params[R]
include ActionView::Helpers::TagHelper
request[R]
include ActionView::Helpers::TagHelper
Public Class Methods
new(request, params)
click to toggle source
# File lib/seorel/helper/base.rb, line 16 def initialize(request, params) @request = request @params = params end
Public Instance Methods
all()
click to toggle source
# File lib/seorel/helper/base.rb, line 47 def all [] end
helpers()
click to toggle source
# File lib/seorel/helper/base.rb, line 21 def helpers ActionController::Base.helpers end
Also aliased as: h
image_url()
click to toggle source
# File lib/seorel/helper/base.rb, line 39 def image_url if /^(http|https|\/\/)/.match(image) image else "#{request.protocol}#{request.host_with_port}#{image}" end end
locale()
click to toggle source
def h.tag(*args)
ActionView::Helpers::TagHelper.h.tag(*args)
end
# File lib/seorel/helper/base.rb, line 31 def locale if I18n.locale.to_s.size == 2 "#{I18n.locale}_#{I18n.locale.to_s.upcase}" else I18n.locale end end
render()
click to toggle source
# File lib/seorel/helper/base.rb, line 51 def render all.join.html_safe end