Hobo Edge has an additional example for filter-menu which filters on
Lifecycle state, which is similar to an enum_string. Here are the docs:
A `<select>` menu intended to act as a filter for index pages.
### Example
Filtering on state is a common use. Here's the dryml for Order:
<filter-menu param-name="state"
options="&Order::Lifecycle.states.keys" />
And the controller action:
def index
# always validate data given in URL's!!!
params[:state]=nil unless
Order::Lifecycle.states.include?(params[:state]._?.to_sym)
finder = params[:state] ? Order.send(params[:state]) : Order
hobo_index finder
end
See [Filtering stories by
status](/tutorials/agility#filtering_stories_by_status) in the [Agility
Tutorial](/tutorials/agility) for an example.
### Attributes
- `param-name` - the name of the HTTP parameter to use for the filter
- `options` - an array of options for the menu.
- `no-filter` - The text of the first option which indicates no filter
is in effect. Defaults to 'All'
Mikkel WF wrote:
How can i make i <filter-menu /> which filters with values from a
enum_string field?
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.