Ruby on Rails

Integrate Adminly into an existing Ruby on Rails web application.

Tip: This guide will show you how to quickly get setup with Adminly for anyone that is interested in self-hosting with an existing Ruby on Rails application.

Requirements

Integrating Adminly into an existing application is currently supported for Ruby on Rails 6+ web applications using the adminly gem. If your existing application does not run on Ruby on Rails, you can still elect to self-host by running adminly as a stand-alone server instance. See our guide to Self-Hosting to learn how to easily deploy an Adminly REST server.

Self-Hosting Requirements

  • Ruby on Rails 6.0 or above

  • Ruby 2.7.3 or above

  • Relational database:

    • PostgreSQL

    • MySQL

    • SQLite

Note: adminly gem is a Ruby on Rails engine, which means it can be mounted on existing applications to extend functionality by exposing new routes, controllers and models, among others. Adminly does not run any database migrations and your database schema will not be altered by integrating with the adminly gem.

Installation

Begin by installing the adminly gem. Add this line to your Gemfile

gem 'adminly'

Install the gem using bundler:

$ bundle install

Mount the API routes by updating your config/routes.rb file:

mount Adminly::Engine, at: "/adminly"

Now the Adminly API routes will be available at your server path /adminly.

You can select any endpoint but for purposes of this documentation we will assume you are using the /adminly endpoint path.

Make your first request

To ensure your API is setup and working, point your browser or query the base endpoint. You should see a response that includes the current version of Adminly.

View Adminly status and version.

GET https://api.myapi.com/adminly/v1

Renders the version of adminly running.

{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}

Take a look at how you might call this method using our official libraries, or via curl:

Adminly.tap |config|
  config.jwt_secret = 'my_jwt_secret_token'
end

Add your API to Adminly

Once your API is installed, copy your jwt_secret and adminly API endpoint as you will use these to configure Adminly online.

Start a new project

  1. Start a new project in Adminly by selecting New Project from the dashboard.

  2. Select "Self-host: existing" when choosing which hosting option.

  3. Enter the name of the project, then enter the JWT_SECRET and the Adminly API endpoint of your hosted server.

Continue through the setup wizard to complete the onboarding process. You should now be able to explore your Adminly data online.

Last updated