docs/12-arbre-components.md in activeadmin-1.0.0 vs docs/12-arbre-components.md in activeadmin-1.1.0
- old
+ new
@@ -1,8 +1,9 @@
---
redirect_from: /docs/12-arbre-components.html
---
+
# Arbre Components
Arbre allows the creation of shareable and extendable HTML components and is
used throughout Active Admin to create view components.
@@ -19,11 +20,11 @@
panel "Post Details" do
attributes_table_for post do
row :id
row 'Tags' do
post.tags.each do |tag|
- a tag, href: admin_post_path(q: {tagged_with_contains: tag})
+ a tag, href: admin_post_path(q: {tagged_with_contains: tag})
text_node " ".html_safe
end
end
end
end
@@ -55,11 +56,11 @@
The Columns component allows you draw content into scalable columns. All you
need to do is define the number of columns and the component will take care of
the rest.
-#### Simple Columns
+### Simple Columns
To create simple columns, use the `columns` method. Within the block, call
the #column method to create a new column.
```ruby
@@ -136,21 +137,18 @@
## Status tag
Status tags provide convenient syntactic sugar for styling items that have
status. A common example of where the status tag could be useful is for orders
that are complete or in progress. `status_tag` takes a status, like
-"In Progress", a type, which defaults to nil, and a hash of options. The
-status_tag will generate html markup that Active Admin css uses in styling.
+"In Progress", and a hash of options. The status_tag will generate HTML markup
+that Active Admin CSS uses in styling.
```ruby
status_tag 'In Progress'
# => <span class='status_tag in_progress'>In Progress</span>
-status_tag 'active', :ok
-# => <span class='status_tag active ok'>Active</span>
-
-status_tag 'active', :ok, class: 'important', id: 'status_123', label: 'on'
-# => <span class='status_tag active ok important' id='status_123'>on</span>
+status_tag 'active', class: 'important', id: 'status_123', label: 'on'
+# => <span class='status_tag active important' id='status_123'>on</span>
```
## Tabs
The Tabs component is helpful for saving page real estate. The first tab will be