docs/5-forms.md in activeadmin-1.0.0.pre2 vs docs/5-forms.md in activeadmin-1.0.0.pre3
- old
+ new
@@ -4,11 +4,11 @@
a thin DSL on top of [Formtastic](https://github.com/justinfrench/formtastic):
```ruby
ActiveAdmin.register Post do
- form do |f|
+ form title: 'A custom title' do |f|
inputs 'Details' do
input :title
input :published_at, label: "Publish Post At"
li "Created at #{f.object.created_at}" unless f.object.new_record?
input :category
@@ -58,10 +58,22 @@
end
```
This is a regular Rails partial so any template engine may be used.
+You can also use the `ActiveAdmin::FormBuilder` as builder in your Formtastic Form for use the same helpers are used in the admin file:
+
+```ruby
+ = semantic_form_for [:admin, @post], builder: ActiveAdmin::FormBuilder do |f|
+ = f.inputs "Details" do
+ = f.input :title
+ - f.has_many :taggings, sortable: :position, sortable_start: 1 do |t|
+ - t.input :tag
+ = f.actions
+
+```
+
## Nested Resources
You can create forms with nested models using the `has_many` method, even if your model uses `has_one`:
```ruby
@@ -133,10 +145,10 @@
This is particularly useful to display errors on virtual or hidden attributes.
# Tabs
-You can arrage content in tabs as shown below:
+You can arrange content in tabs as shown below:
```ruby
form do |f|
tabs do
tab 'Basic' do