Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kieranklaassen/mercury_rails_regions

A CMS like solution with Mercury-rails as an editor. Just make regions in your views and your admin can begin editing.
https://github.com/kieranklaassen/mercury_rails_regions

Last synced: 3 days ago
JSON representation

A CMS like solution with Mercury-rails as an editor. Just make regions in your views and your admin can begin editing.

Awesome Lists containing this project

README

        

# MercuryRailsRegions

Add mercury-regions to a view and save the content to the database.

## Installation

Add this line to your application's Gemfile:

gem 'mercury_rails_regions'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mercury_rails_regions

Run the rails generator to add the page model

$ rails generate mercury_regions:install:pages_model
$ rails db:migrate

## Usage

To add an editable region to your view use the following code

``` erb

About


<%= mercury_region "about-introduction" %>

<%= mercury_region "about-aside" %>

```

When current_admin_user.signed_in? and you go to `/editor/about` this will render as follows:
``` html

About



contents intro


contents aside

```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request