codelation_pages 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +19 -1
- data/lib/codelation_pages/version.rb +1 -1
- data/lib/extensions/action_dispatch/routing/mapper.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40daeec35ee06a74876f3ecc888d6298b0bcaf15
|
4
|
+
data.tar.gz: 057b78d2ab08426a0eb42ba510eb51489f8a2fd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e57bd565bf89e43a0c57f880570958d07fdf095f7eca8b70c95c572025b3529f22bf21cabe9a71e79e36af36d861b13b00bcb2e654844aba2d61abceacacb32e
|
7
|
+
data.tar.gz: 3ae3a38d45ee05cd2fb548a7c979e89870f8fc0b78059801af92f29275e8a56bde7ec249468106474df93b483d5fea0d9daf1fa035be83dc3124a8e3a55e2912
|
data/README.md
CHANGED
@@ -58,7 +58,25 @@ end
|
|
58
58
|
|
59
59
|
## IMPORTANT
|
60
60
|
|
61
|
-
**You will need to restart your Rails server after adding new page files
|
61
|
+
**You will need to restart your Rails server after adding new page files.**
|
62
|
+
|
63
|
+
## Page Titles
|
64
|
+
|
65
|
+
I recommend using the [Title](https://github.com/calebthompson/title) gem for storing page titles. Using `codelation_pages`, your `en.yml` file will look something like this:
|
66
|
+
|
67
|
+
```yml
|
68
|
+
en:
|
69
|
+
titles:
|
70
|
+
application: This is the default title
|
71
|
+
pages:
|
72
|
+
about_us: About Us
|
73
|
+
features:
|
74
|
+
index: Features
|
75
|
+
overview: Features > Overview
|
76
|
+
index: Home Page
|
77
|
+
posts:
|
78
|
+
index: Codelation Blog
|
79
|
+
```
|
62
80
|
|
63
81
|
## Contributing
|
64
82
|
|
@@ -32,7 +32,7 @@ module ActionDispatch
|
|
32
32
|
# Returns whether or not a custom controller file exists.
|
33
33
|
# @param directory_name [String]
|
34
34
|
def custom_controller_exists(directory_name)
|
35
|
-
File.exist?(Rails.root.join("app", "controllers", "pages", "#{directory_name}_controller.rb"))
|
35
|
+
return true if File.exist?(Rails.root.join("app", "controllers", "pages", "#{directory_name}_controller.rb"))
|
36
36
|
end
|
37
37
|
|
38
38
|
# Draws the routes for static pages within sub folders.
|
@@ -97,12 +97,14 @@ module ActionDispatch
|
|
97
97
|
|
98
98
|
# Returns whether or not the PagesController file exists.
|
99
99
|
def pages_controller_exists
|
100
|
-
File.exist?(Rails.root.join("app", "controllers", "pages_controller.rb"))
|
100
|
+
return true if File.exist?(Rails.root.join("app", "controllers", "pages_controller.rb"))
|
101
|
+
Object.const_defined?("PagesControllers")
|
101
102
|
end
|
102
103
|
|
103
104
|
# Returns whether or not the pages module directory exists
|
104
105
|
def pages_module_exists
|
105
|
-
File.exist?(Rails.root.join("app", "controllers", "pages"))
|
106
|
+
return true if File.exist?(Rails.root.join("app", "controllers", "pages"))
|
107
|
+
Object.const_defined?("Pages")
|
106
108
|
end
|
107
109
|
end
|
108
110
|
end
|