README.textile in nofxx-formtastic-0.1.6 vs README.textile in nofxx-formtastic-0.1.7
- old
+ new
@@ -1,9 +1,13 @@
-h1. Formtastic 0.1.3
+h1. Formtastic 0.1.4
Formtastic is a Rails FormBuilder DSL (with some other goodies) to make it far easier to create beautiful, semantically rich, syntactically awesome, readily stylable and wonderfully accessible HTML forms in your Rails applications.
+h2. Warning
+
+This fork adds jQuery only add/remove nested partial.
+
h2. The Story
One day, I finally had enough, so I opened up my text editor, and wrote a DSL for how I'd like to author forms:
<pre>
@@ -81,23 +85,30 @@
</pre>
And then add it as a dependency in your environment.rb file:
<pre>
- config.gem "justinfrench-formtastic",
- :lib => 'formtastic',
- :source => 'http://gems.github.com',
- :version => '0.1.3'
+ config.gem "justinfrench-formtastic",
+ :lib => 'formtastic',
+ :source => 'http://gems.github.com',
+ :version => '0.1.4'
</pre>
If you're a little more old school, install it as a plugin:
<pre>
./script/plugin install git://github.com/justinfrench/formtastic.git
</pre>
+h3. jQuery
+To use the cliente side add/remove partial, make sure you got:
+
+* "jquery.template":http://stanlemon.net/projects/jquery-templates.html
+
+Avaiable on the DOM.
+
h2. Usage
Forms are really boring to code... you want to get onto the good stuff as fast as possible.
This renders a set of inputs (one for _most_ columns in the database table, and one for each ActiveRecord belongs_to, has_many or has_and_belongs_to_many association) and a submit button:
@@ -154,22 +165,24 @@
<%= form.commit_button %>
<% end %>
<% end %>
</pre>
-If you want to customize html elements for any non button inputs you just need
-to specify the :input_html options hash.
+If you want to customize html elements for any non button inputs and the li
+wrapper you just need to specify the :input_html and :wrapper_html options hash.
<pre>
<% semantic_form_for @post do |form| %>
<%= form.input :title, :input_html => {:size => 60} %>
- <%= form.input :body %>
+ <%= form.input :body, :wrapper_html => { :class => 'body_wrapper' } %>
<%= form.input :created_at, :input_html => {:disabled => true} %>
<%= form.buttons %>
<% end %>
</pre>
+To customize buttons, :button_html is available.
+
Nested forms (Rails 2.3) are also supported. You can do it in the Rails way:
<pre>
<% semantic_form_for @post do |form| %>
<%= form.inputs :title, :body, :created_at %>
@@ -235,18 +248,18 @@
Formtastic::SemanticFormBuilder.default_text_field_size = 30
# Should all fields be considered "required" by default
# Defaults to true, see ValidationReflection notes below
Formtastic::SemanticFormBuilder.all_fields_required_by_default = false
-
+
# Set the string that will be appended to the labels/fieldsets which are required
# It accepts string or procs and the default is a localized version of
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
# in your locale, it will replace the abbr title properly. But if you don't want to use
# abbr tag, you can simply give a string as below
Formtastic::SemanticFormBuilder.required_string = "(required)"
-
+
# Set the string that will be appended to the labels/fieldsets which are optional
# Defaults to an empty string ("") and also accepts procs (see required_string above)
Formtastic::SemanticFormBuilder.optional_string = "(optional)"
# Set the way inline errors will be displayed.
@@ -327,25 +340,27 @@
h2. Contributors
Formtastic wouldn't be as awesome as it is today if it weren't for the wonderful contributions of these fine, fine coders. An extra huge thanks goes out to "José Valim":http://github.com/josevalim for nearly 50 patches.
* "Justin French":http://justinfrench.com
+* "José Valim":http://github.com/josevalim
+* "Jeff Smick":http://github.com/sprsquish
+* "Tien Dung":http://github.com/tiendung
+* "Mark Mansour":http://stateofflux.com
+* "Andy Pearson":http://github.com/andypearson
+* "negonicrac":http://github.com/negonicrac
* "Xavier Shay":http://rhnh.net
-* "Bin Dong":http://github.com/dongbin
-* "Ben Hamill":http://blog.benhamill.com/
* "Pat Allan":http://github.com/freelancing-god
-* "negonicrac":http://github.com/negonicrac
-* "Andy Pearson":http://github.com/andypearson
-* "Mark Mansour":http://stateofflux.com
-* "Tien Dung":http://github.com/tiendung
-* "Sascha Hoellger":http://github.com/mitnal
-* "Jeff Smick":http://github.com/sprsquish
-* "José Valim":http://github.com/josevalim
-* "Greg Fitzgerald":http://github.com/gregf/
* "Gareth Townsend":http://github.com/quamen
+* "Sascha Hoellger":http://github.com/mitnal
+* "Andrew Carpenter":http://github.com/andrewcarpenter
* "Jack Dempsey":http://github.com/jackdempsey/
+* "Greg Fitzgerald":http://github.com/gregf/
+* "Hector E. Gomez Morales":http://github.com/hectoregm
+* "Ben Hamill":http://blog.benhamill.com/
* "Simon Chiu":http://github.com/tolatomeow
-
+* "Bin Dong":http://github.com/dongbin
+* "Marcos Piccinini":http://github.com/nofxx
h2. Hey, join the Google group!
Please join the "Formtastic Google Group":http://groups.google.com.au/group/formtastic, especially if you'd like to talk about a new feature, or report a bug.