Skip to content

Commit

Permalink
add set_html_meta! method for overwriting meta
Browse files Browse the repository at this point in the history
  • Loading branch information
yulii committed Sep 9, 2013
1 parent 9ab6ba4 commit 28fc257
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions lib/snipp/markups/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ module Html

def set_html_meta args, options = {}
i18n_options = {
#scope: ([:views].push(*params[:controller].split('/')) << params[:action] << :meta),
scope: [:views, params[:controller], params[:action], :meta],
scope: (([:views] + params[:controller].split('/')) << params[:action] << :meta),
default_scope: [:default, :meta]
}.merge(options)

Expand All @@ -18,6 +17,16 @@ def set_html_meta args, options = {}
end
end

def set_html_meta! args
@html_meta = {}
link = args.delete(:link)
html_meta.merge!(link: link) if link

args.each do |name, content|
html_meta[name] = html_meta_contents(name, content, content, {}) if content
end
end

def html_meta_tags
result = ''
set_html_meta({}) if html_meta.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/snipp/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Snipp
VERSION = "0.1.2"
VERSION = "0.1.3"
end

0 comments on commit 28fc257

Please sign in to comment.