Getting started
Installation
Your application DB must be created first with bundle exec rails db:create
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
Prepare your app
Execute maglev setup
within the folder of your rails app and follow screen instructions.
Create a theme and a first section
Create a first theme
and a dummy section
It's now time to run your Rails app server.
Please visit http://localhost:3000/maglev/admin, you will see your new theme and section.
Create programmatically your first site
We'll assume that you want to offer a site for each instance of the Account model in your application. Remember that you have made the choice of the parent model during the installation.
We're now going to create a new Maglev site based on the Simple theme and link it to one of your accounts.
Open your rails console
And type the following lines of Ruby code
In the next steps, inside your Rails application, you'll have to call the Maglev::Pro::GenerateSite service from one of your controller action, a model callback or your own service.
In order to get the editor UI url, in the Rails console, type:
It will return an url similar to this one: http://localhost:3000/maglev/black-wildflower-1100/editor/en/index.
Last updated