pagelime-rails 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Readme.md +59 -38
- data/VERSION +1 -1
- data/lib/pagelime-rails.rb +1 -0
- data/lib/pagelime/s3_rails_cache.rb +1 -1
- data/pagelime-rails.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTViNzIyMTI1MzU3ZTc4MzljNmQyMzg5ZjVhYjI1ZTRhYThhYWJhYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWMwY2YxZGJkMmY3ZjEzYWI3ZTg0NjQ0NmE1MzA3OTUzZjZmZTIzMQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTRlNGQ0ODdjMjcxNTJmODRkNmUxYjFhN2VmZDhkY2Q3MGYxNjk2YjVhYzMy
|
10
|
+
NWUxYzIzMDNkMGEwNjAzOGVmOTg1YTViYzliZjIzNDg0NThmNWJhYTFlNGI1
|
11
|
+
MTU0MzBkMjZkMmE3YWI5MGJhZWNiZGM3MGMxNDc4YzAyMmQwN2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTQ1ZGFlZGE2NTBhNzFhYTg4NWQ3YzQ4ODA1YTBlMGQ0NjRhNWJmNzczMjdi
|
14
|
+
OGUyZWNmYmFmOTdhZjM0YjRjZDU3NTQwY2ZhNWRlYzlhMTFkMTZmZGFjNjlm
|
15
|
+
NjEwNGI4NWFkZDkwZDExYTdhMWE0MWI4NGIzZjk5ZGE3MjEwNDY=
|
data/Readme.md
CHANGED
@@ -1,81 +1,102 @@
|
|
1
1
|
Pagelime Rails Plugin
|
2
2
|
=====================
|
3
3
|
|
4
|
-
Easily add the Pagelime CMS to your
|
4
|
+
Easily add the Pagelime CMS to your Rails app.
|
5
5
|
|
6
|
-
Pagelime is a simple CMS service that allows you to define editable regions in your content without installing any software on your site or app.
|
6
|
+
Pagelime is a simple CMS service that allows you to define editable regions in your content without installing any software on your site or app.
|
7
|
+
Simply add a `class="cms-editable"` to any HTML element, and log-in to the Pagelime CMS service to edit your content and images with a nice UI.
|
8
|
+
We host all of the code, content, and data until you publish a page.
|
9
|
+
When you publish a page, we push the content to your site/app via secure FTP or web APIs.
|
7
10
|
|
8
11
|
One line example:
|
9
|
-
|
12
|
+
|
13
|
+
<div id="my_content" class="cms-editable">
|
14
|
+
This content is now editable in Pagelime... no code... no databases... no fuss
|
15
|
+
</div>
|
10
16
|
|
11
17
|
Getting Started
|
12
18
|
---------------
|
13
19
|
|
14
|
-
Requirements
|
15
|
-
|
16
|
-
* Pagelime account (either a standalone from pagelime.com or as a Heroku add-on)
|
17
|
-
* Nokogiri gem
|
20
|
+
### Requirements
|
18
21
|
|
19
|
-
|
20
|
-
|
22
|
+
* Pagelime account (either standalone [pagelime.com](http://pagelime.com) or via the [Pagelime Heroku add-on](https://addons.heroku.com/pagelime))
|
23
|
+
* [Pagelime Rack gem](https://github.com/eanticev/pagelime_rack) (`pagelime-rack`)
|
21
24
|
|
22
|
-
### Step
|
23
|
-
Require the **pagelime_rails** gem
|
25
|
+
### Step 1: Install the Pagelime Rails gem
|
24
26
|
|
25
27
|
#### For Rails 2
|
26
|
-
edit your `config/environment.rb` file and add:
|
27
28
|
|
28
|
-
`config.
|
29
|
+
Edit your `config/environment.rb` file and add:
|
30
|
+
|
31
|
+
config.gem "pagelime-rails"
|
29
32
|
|
30
33
|
then run
|
31
34
|
|
32
|
-
|
35
|
+
rake gems:install
|
33
36
|
|
34
37
|
#### For Rails 3
|
35
|
-
edit your `Gemfile` and add
|
36
38
|
|
37
|
-
`
|
39
|
+
Edit your `Gemfile` and add
|
40
|
+
|
41
|
+
gem "pagelime-rails"
|
38
42
|
|
39
43
|
then run
|
40
44
|
|
41
|
-
|
45
|
+
bundle install
|
42
46
|
|
43
|
-
### Step
|
44
|
-
Add the plugin routes to your `config/routes.rb` configuration:
|
47
|
+
### Step 2: Setup your Pagelime credentials
|
45
48
|
|
46
|
-
|
49
|
+
*(Skip if using Heroku add-on)*
|
47
50
|
|
48
|
-
|
51
|
+
If you are NOT using the [Pagelime Heroku add-on](https://addons.heroku.com/pagelime), set up an account at [pagelime.com](http://pagelime.com).
|
52
|
+
Make sure that the "Integration Method" for your site on the advanced tab is set to "web services".
|
49
53
|
|
50
|
-
|
54
|
+
### Step 3: Configure your application
|
51
55
|
|
52
|
-
|
53
|
-
For any controller that renders views that you want editable, add the acts_as_cms_editable behavior like so:
|
56
|
+
For any controller that renders views that you want editable, add the `acts_as_cms_editable` behavior like so:
|
54
57
|
|
55
58
|
class CmsPagesController < ApplicationController
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
59
|
+
# attach the cms behavior to the controller
|
60
|
+
acts_as_cms_editable
|
61
|
+
|
62
|
+
def index
|
63
|
+
end
|
61
64
|
end
|
62
65
|
|
63
66
|
You can pass an `:except` parameter just like with a filter like so:
|
64
67
|
|
65
|
-
|
68
|
+
acts_as_cms_editable :except => :index
|
69
|
+
|
70
|
+
#### Only for Rails 2.3.x
|
71
|
+
|
72
|
+
Add the plugin routes to your `config/routes.rb` configuration:
|
73
|
+
|
74
|
+
map.cms_routes
|
75
|
+
|
76
|
+
These routes are used by Pagelime to clear any caches after save and publish events on your files.
|
77
|
+
|
78
|
+
*Rails 3 does not need this statement, as the plugin will behave as an engine*
|
79
|
+
|
80
|
+
#### Additional configuration options
|
81
|
+
|
82
|
+
*Read the [`pagelime-rack`](https://github.com/eanticev/pagelime_rack) documentation for more configuration options.*
|
83
|
+
|
84
|
+
### Step 4: Make pages editable
|
66
85
|
|
67
|
-
### Step 5.
|
68
86
|
Create some editable regions in your views like so:
|
69
87
|
|
70
|
-
|
88
|
+
<div id="my_content" class="cms-editable">
|
89
|
+
this is now editable
|
90
|
+
</div>
|
71
91
|
|
72
92
|
*The ID and the class are required for the CMS to work*
|
73
93
|
|
74
|
-
|
75
|
-
If you don't want to have your entire controller CMS editable for some reason, you can sorround areas in your view with a code block like so:
|
94
|
+
Optionally: If you don't want to have your entire controller CMS editable for some reason, you can sorround areas in your view with a code block like so:
|
76
95
|
|
77
|
-
|
78
|
-
|
79
|
-
|
96
|
+
<% cms_content do %>
|
97
|
+
<div id="my_content" class="cms-editable">
|
98
|
+
hello world
|
99
|
+
</div>
|
100
|
+
<% end %>
|
80
101
|
|
81
|
-
Copyright (c)
|
102
|
+
Copyright (c) 2013 Pagelime LLC, released under the MIT license
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/pagelime-rails.rb
CHANGED
data/pagelime-rails.gemspec
CHANGED