Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document recent changes in README.

Include details on how to use the provided Rails engine and helper.
Mention Haml requirement.
  • Loading branch information...
commit 82e71e89045c096a8bebb6b0b030811faa3ef1e6 1 parent eed2355
@tylerhunt authored
Showing with 29 additions and 4 deletions.
  1. +29 −4 README.md
View
33 README.md
@@ -7,6 +7,12 @@ form builder in Rails, and a Sass stylesheet to provide some level of stylistic
normalization.
+## Haml Requirement
+
+Formulate's `FormBuilder` relies on some helper methods provided by Haml, so
+it will only work when used within Haml templates.
+
+
## Installation
Add this line to your application's `Gemfile`:
@@ -15,6 +21,13 @@ Add this line to your application's `Gemfile`:
gem 'formulate'
```
+If you want to use the Formulate's `#form_for` helper by default, an engine
+is provided that will override Rails' helper:
+
+``` ruby
+gem 'formulate', require: 'formulate/engine'
+```
+
And then execute:
$ bundle
@@ -26,12 +39,24 @@ Or install it yourself as:
## Usage
-The form builder will be used automatically whenever the `#form_for` helper is
-called, so you don't need to do anything special to start using its methods. It
-also doesn't clobber any of the built-in form builder methods, so your forms
-should continue to work without modification, giving you the ability to
+Formulate provides a helper module that can be included in your Rails
+controllers. You can also load the helper in your `ApplicationController` to
+use it across your whole app.
+
+``` ruby
+class ApplicationController < ActionController::Base
+ helper Formulate::FormHelper
+end
+```
+
+Formulate doesn't clobber any of the built-in form builder methods, so your
+forms should continue to work without modification, giving you the ability to
selectively begin using Formulate in your applications where you see fit.
+If you're using the engine, the form builder will be used automatically
+whenever the `#form_for` helper is called, so you don't need to do anything
+special to start using it.
+
## Styles
Please sign in to comment.
Something went wrong with that request. Please try again.