Module: SmartMeta
- Defined in:
- lib/smart_meta.rb
Instance Method Summary collapse
- #smart_description ⇒ Object
- #smart_keywords ⇒ Object
- #smart_meta_for(kind) ⇒ Object
- #smart_title ⇒ Object
Instance Method Details
#smart_description ⇒ Object
14 15 16 |
# File 'lib/smart_meta.rb', line 14 def smart_description (:description) end |
#smart_keywords ⇒ Object
18 19 20 |
# File 'lib/smart_meta.rb', line 18 def smart_keywords (:keywords) end |
#smart_meta_for(kind) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/smart_meta.rb', line 2 def (kind) key = [params[:controller], params[:action], kind].compact.join('.') if (title_template = translation_for(key)) needed_args = title_template.scan(/\{\{(.*?)\}\}/).flatten args = needed_args.inject({}) do |hash, arg| hash[arg.to_sym] = value_from_arg(arg) hash end I18n.t(key, args) end end |
#smart_title ⇒ Object
22 23 24 |
# File 'lib/smart_meta.rb', line 22 def smart_title (:title) end |