https://github.com/apiqcms/kms_feedback
KMS extension for feedback/callback/contact forms
https://github.com/apiqcms/kms_feedback
Last synced: 3 months ago
JSON representation
KMS extension for feedback/callback/contact forms
- Host: GitHub
- URL: https://github.com/apiqcms/kms_feedback
- Owner: apiqcms
- License: mit
- Created: 2016-11-21T13:14:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T14:21:19.000Z (almost 9 years ago)
- Last Synced: 2025-01-15T10:14:00.442Z (about 1 year ago)
- Language: Ruby
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
## KMS Feedback
This extension allows submitting contact/callback/feedback forms from frontend side and having it under "Messages" section in [KMS](https://github.com/webgradus/kms). When ActionMailer settings setup, it notifies selected users about new messages by email as well.
## Installation
1. Add to Gemfile:
gem "kms_feedback"
# or for edge version:
gem "kms_feedback", github: "webgradus/kms_feedback"
2. Run generator:
rails g kms_feedback:install
3. Copy migrations:
rails kms_feedback:install:migrations
4. Migrate:
rails db:migrate
5. Recompile assets:
rails assets:precompile
6. Restart KMS instance
## Usage
Your form on webpage should look like this:
IMPORTANT!
Necessary to have form's action and method exactly like above (as well as inputs names).
And don't forget about `authenticity_token`.
Form validation should happen completely on client side (you could use HTML5 attrs or parsley.js or something similar).
You can use only some of fields - only `name` and `phone` for example.
To make AJAX submit you would have something like this JavaScript code:
$(document).ready(function(){
$('input[type="button"]').click(function(){
$.post('/feedbacks', $('form[action="/feedbacks"]').serialize());
});
});
and add validation as well.
This extension also provides adding Recaptcha to forms. For adding validation with Recaptcha:
1. Insert this fragment before closing in your HTML:
2. Insert this fragment at the bottom of contents (where you need to place reCAPTCHA widget):
3. Enable Recaptcha under "Settings" (check dropdown menu on avatar clicking)
Another way to prevent spam is to enable Invisible Captcha (check out Settings in your KMS admin section). For adding validation with InvisibleCaptcha:
1. Insert this fragment into your feedback form:
2. Enable Invisible Captcha under "Settings" (check dropdown menu on avatar clicking)
This project rocks and uses MIT-LICENSE.