README.md in revelry_content-0.0.1 vs README.md in revelry_content-0.0.1.1
- old
+ new
@@ -88,38 +88,34 @@
```
### Editable text
```erb
-<%= editable_text(lookup, t, user) %>
+<%= revelry_content_text('home.title', default: 'Hello, World!') %>
```
`lookup` is a lookup hash of the available content. If you have included `RevelryContent::WithRevelryContent` in your controller, `@revelry_content_contents` is the default lookup with all content.
-`t` is the content key of the content, which is just a unique string for each piece of changeable content.
+In this case `'home.headline'` is the content key of the content, which is just a unique string for each piece of changeable content.
-`user` is the user to give to the authorization policy. With devise, this is often `current_user`.
+The `default` param is what is shown if know one has set any content yet.
+(Think brand-new sites.)
-So for, an editable homepage headline, with the standard lookup and
-`current_user` as the user, you would invoke the helper like this:
-
-```erb
-<%= editable_text(@revelry_contents_content, 'home.headline', current_user, default_text: 'Lorem ipsum') %>
-```
-
### Editable images
Editable images work in a similar manner to editable text:
```erb
-<%= editable_image(@revelry_contents_content, 'home.image', current_user, default_url: 'http://placehold.it/200x200') %>
+<%= revelry_content_image('home.image', default: 'http://placehold.it/200x200') %>
```
-# Using in javascript (including React)
+Here, `home.image` is the content key for the image to display, and `default` provides a placeholder image URL.
-## Making content available to javascript
+# Using in JavaScript (including React)
+## Making content available to JavaScript
+
You can configure RevelryContent to export all of your content into javascript.
```ruby
RevelryContent.configure do |config|
config.js_export = true
@@ -142,10 +138,10 @@
```javascript
RevelryContent.Content.home.headline
```
-The javascript export will automatically update whenever content is updated.
+The JavaScript export will automatically update whenever content is updated.
## Adding Editable Sections with React
RevelryContent is built on React, so you can also directly invoke the React components: