Module: MetaManager::Helper
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/meta_manager/helper.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/meta_manager/helper.rb', line 5 def self.included(base) base.send :helper_method, :render_meta_tags, :render_page_title end |
Instance Method Details
#render_meta_tags(record) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/meta_manager/helper.rb', line 9 def (record) return if record.nil? dynamic = self.instance_variable_get("@meta_dynamic") = [] (record, dynamic).each do || unless .name == 'title' type = .name =~ /og:/ ? 'property' : 'name' << tag(:meta, type => .name, :content => ()) end end .join("\n\s\s") end |
#render_page_title(record = nil, options = {}) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/meta_manager/helper.rb', line 25 def render_page_title(record=nil, = {}) dynamic = self.instance_variable_get("@meta_dynamic") = (record, dynamic) .detect{|t| t.name == 'title'}.try(:get_content, self) || get_page_title(record, ) end |