diff --git a/README.md b/README.md index 9ea9829..b3c0593 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # DynamicForms -Short description and motivation. +This is a gem to create custom forms. +The custom form is a logical entity that allows adding a lot of submissions with any parameter and they can be stored in a database and/or sent to some emails -## Usage -How to use my plugin. +This gem support **Rails 5** and later ## Installation Add this line to your application's Gemfile: @@ -13,7 +13,7 @@ gem 'dynamic_forms' And then execute: ```bash -$ bundle +$ bundle install ``` Or install it yourself as: @@ -21,8 +21,88 @@ Or install it yourself as: $ gem install dynamic_forms ``` +After then you need to create migrations, to do this run +```bash +$ rails dynamic_forms:install:migrations +``` +To add the custom_form routes you need to add the next line into your routes file + +```ruby +mount DynamicForms::Engine => "/dynamic_forms" +``` +You can change the path name from `dynamic_forms` to your awesome name what you want to use. + +## Usage + +Use this gem is very simple, you only need to create a new form with a name. + + +To config the form you need to go to the edit/settings page + + + +On this page, we see the endpoint where you can send new submissions. + +Also, you can: +- Add target email to send the submission +- Enable/Disable the form +- Enable/Disable email notifications to target email +- Enable/Disable the option to record data on the DB +- Restrict the request to a specific domain (and subdomains) + +Here an example of how the submissions page looks + + +In this case, we create a table with those headers, but you can overwrite the views to change the table. + +## How it works +the gem gives you a public endpoint for each form that you create, you can consume this endpoint of different ways. + +You can use this a simple form with HTML or create a complex with some JS Technology + +Here an HTML example + +``` + + +
+ +