Formulae Example

A complex Form react based

How to use this app

  • In this app, we are using the api key: 'API_KEY'. It means you need to have in the Formulae backend one application having this api key.
  • Click in one of the links in the sidebar and pass the form_id.

How to use Formulae in your Rails app

Add the Formulae Ruby gem

Add in your Gemfile the `formulae_ruby` gem.

Set up webpack

We suggest using Webpacker with your Rails App. Once you have set up webpack. In development, you'll need to run ./bin/webpack-dev-server in a separate terminal from ./bin/rails server to have your app/javascript/packs/*.js files compiled as you make changes.

You can check how we are integrating the components in this example app.

Embed the component

Now you have imported the components, you can embed the component in your rails code. To work better with Formulae, we suggest adding in your Gemfile the `formulae_ruby` gem. To embed the component, we are using a javascript function where we pass the correct variables for each component.