so_meta 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/so_meta/helper.rb +9 -2
- data/lib/so_meta/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceb9c4aed13f9bf186fa9733bbdef52e70b796fd
|
4
|
+
data.tar.gz: 84fc06bca24ec06806f370e9887e1634a5a1b688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1fcf30d47fd4a9f544e0777dfa1dfc79a4b69b79c7971b74cc79ef2508abee230245d36c30e27b06232b566ce4b808dd1b3eb24bb1fee06a57414856d7e7ba6
|
7
|
+
data.tar.gz: 01644a5280496b5db20ad30950cce2035557cd9ebfce6e4549f738f9685bbd3e3f07e548f280494a333dd1dbf2ac5522edf8a7c8e17f2f0e6eceec764aaaba92
|
data/README.md
CHANGED
@@ -35,11 +35,14 @@ en:
|
|
35
35
|
title: "About | My Awesome New Rails Application"
|
36
36
|
description: "Our company will blow your mind...like really."
|
37
37
|
|
38
|
-
|
38
|
+
pages_subresource: # Controller name - Pages::SubresourceController
|
39
39
|
about: # Action name - about
|
40
40
|
title: "About | My Awesome New Rails Application"
|
41
41
|
description: "Our company will blow your mind...like really."
|
42
42
|
|
43
|
+
iphone:
|
44
|
+
title: "iPhone About | My Awesome New Rails Application"
|
45
|
+
|
43
46
|
contact:
|
44
47
|
title: "Contact %{name} | My Awesome New Rails Application" # Interpolation content from the view
|
45
48
|
# By not specifying a description for this page, it'll inherit the defaults
|
@@ -51,7 +54,7 @@ en:
|
|
51
54
|
<!DOCTYPE html>
|
52
55
|
<html lang="en">
|
53
56
|
<head>
|
54
|
-
<title><%= so_meta(:title) %></title>
|
57
|
+
<title><%= so_meta(:title, :iphone) %></title>
|
55
58
|
<meta name="description" content="<%= so_meta(:description) %>" />
|
56
59
|
<%= csrf_meta_tags %>
|
57
60
|
</head>
|
data/lib/so_meta/helper.rb
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
module SoMeta
|
2
2
|
module Helper
|
3
|
-
def so_meta(name)
|
3
|
+
def so_meta(name, scope = nil)
|
4
4
|
interpolation_data = instance_variable_get("@so_meta_#{name}_interpolation") || {}
|
5
|
-
|
5
|
+
|
6
|
+
controller_name = controller_path.gsub(/\//, "_")
|
7
|
+
|
8
|
+
if scope.present?
|
9
|
+
t("so_meta.#{controller_name}.#{action_name}.#{scope}.#{name}",
|
10
|
+
default: t("so_meta.#{controller_name}.#{action_name}.#{name}", interpolation_data.merge(default: t("so_meta.defaults.#{name}")))
|
11
|
+
)
|
12
|
+
end
|
6
13
|
end
|
7
14
|
|
8
15
|
def so_meta_interpolation(name, hash)
|
data/lib/so_meta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: so_meta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hilkert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|