Idea: field groups

2 views
Skip to first unread message

Matt Jones

unread,
Oct 14, 2009, 2:19:10 PM10/14/09
to hobo...@googlegroups.com
Was setting up a new app today, and had an idea: what if the fields
block could 'group' fields somehow. Here's a sketch:

fields do
group :contact_info do
email_address :email_address, :login => true
first_name :string
middle_name :string
last_name :string
suffix :string
nickname :string
organization :string
address_line_1 :string
address_line_2 :string
city :string
state :state_abbr
zipcode :us_zip_code
country :string
end
group :some_fields_the_user_shouldnt_change do
magic_field :string
end
end

Then one could reference those group names somehow in, for instance,
only_changed? or none_changed? to simplify permissions checking. Rapid
might want to wrap a group in a named fieldset tag, to make a long
form look nicer, and so on.

Does this make sense to anybody else?

--Matt Jones

kevinpfromnm

unread,
Oct 14, 2009, 4:18:38 PM10/14/09
to Hobo Users
Yeah. I could definitely see it being useful, especially for
complicated models. That said, I could also see it being a pain to
implement/maintain.

Owen

unread,
Oct 14, 2009, 4:21:05 PM10/14/09
to Hobo Users
Yep. Absolutely.

Hey Matt, I would like to put the Hobo index DSL you developed into a
tutorial for "Rapid rails with Hobo." I have the next few days off.

What state is your branch in now?

Thanks,

Owen

Tom Locke

unread,
Oct 17, 2009, 3:48:16 AM10/17/09
to hobo...@googlegroups.com
> Was setting up a new app today, and had an idea: what if the fields
> block could 'group' fields somehow

I like this too - I've definitely found that fields fall naturally
into groups in my apps

Tom

Reply all
Reply to author
Forward
0 new messages