petrie 0.1.0 → 0.1.1
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 +6 -0
- data/app/controllers/petrie/pages_controller.rb +7 -2
- data/lib/petrie/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: da9f08cdff2520b7dc307b54a72dca682e079631
|
4
|
+
data.tar.gz: 293896af6ae9f4ba2715c00d388ecc10e56ba982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d09577468c323cc83b32b0819e18412f7dc8d3e30bb1b627f3d7837186d6cd7f314f17f37ffad777564d50c3ef3c705e4db55dacfe3b993ae6a1e5a0c537906b
|
7
|
+
data.tar.gz: 069be96b2803f604bc39b828478bce9fc30bf805b51b20f1301d63e91f6813bfbe5d9b95362871c8609223829ac16efc2a6f7329a82aabb35b9e935b93af045a
|
data/README.md
CHANGED
@@ -19,12 +19,18 @@ Then run the installer
|
|
19
19
|
|
20
20
|
## ActiveAdmin
|
21
21
|
|
22
|
+
**Heads up!** You need to have ActiveAdmin installed first!
|
23
|
+
|
22
24
|
rails g petrie:activeadmin
|
23
25
|
|
24
26
|
# Caution
|
25
27
|
|
26
28
|
Petrie includes a root route to `pages#home`. Generally, this shouldn't be a problem unless you don't want to use a marketing home page as your root.
|
27
29
|
|
30
|
+
# Known issues
|
31
|
+
|
32
|
+
* There are missing blocks in sir-trevor-rails that will cause template errors. The workaround is to create these blocks in your application in `app/views/sir-trevor/blocks` until this gets fixed.
|
33
|
+
|
28
34
|
## License
|
29
35
|
|
30
36
|
MIT License
|
@@ -4,17 +4,22 @@ module Petrie
|
|
4
4
|
class PagesController < ApplicationController
|
5
5
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
6
6
|
|
7
|
+
before_filter :assign_page
|
8
|
+
|
7
9
|
def home
|
8
10
|
end
|
9
11
|
|
10
12
|
def show
|
11
|
-
@page = find_by_slug
|
12
13
|
end
|
13
14
|
|
14
15
|
private
|
15
16
|
|
17
|
+
def assign_page
|
18
|
+
@page = find_by_slug
|
19
|
+
end
|
20
|
+
|
16
21
|
def find_by_slug
|
17
|
-
page_slugs = params[:page].split(/\//).reverse
|
22
|
+
page_slugs = (params[:page] || 'home').split(/\//).reverse
|
18
23
|
candidates = Page.where(slug: page_slugs.first)
|
19
24
|
|
20
25
|
return not_found if candidates.empty?
|
data/lib/petrie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petrie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nic Aitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|