Formily
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/form/builder
. To experiment with that code, run bin/console
for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
Installation
Add this line to your application's Gemfile:
gem 'formily'
And then execute:
$ bundle
Or install it yourself as:
$ gem install formily
Usage
Run:
$ rails generate formily:install
then:
$ rake db:migrate
Add into application.css:
//=require formily
Add into application.js:
//= require formily
Add into application layout:
<body>
...
<%= formily_modal_tag %>
</body>
Dependency:
//= require jquery
//= require jquery_ujs
//= require jquery-ui
View helpers
URL helpers:
formily_forms_connect_form POST /formily/forms/connect_form formily/forms#connect_form
formily_forms GET /formily/forms formily/forms#index
new_formily_forms GET /formily/forms/new formily/forms#new
formily_form_show GET /formily/forms/:id formily/forms#show
formily_forms_edit GET /formily/forms/:id/edit formily/forms#edit
formily_form_delete DELETE /formily/forms/:id formily/forms#destroy
formily_submit_data_submit POST /formily/submit_data/submit formily/submit_data#submit
View helpers:
new_formily_form_btn('New', class: 'button')
edit_formily_form_btn(@form)
new_formily_form_link
edit_formily_form_link(@form)
formily_form_editor_btn_tag(@some_model)
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.