Guys:
Stuck at the mall today, and just had to crack Rails Cookbook, by
O''Reily. It
had a recipe for accepting dynamically created forms. The sample output looked
like this (reconstructed):
p params[:my_form]
> ["1-1" => 0, "1-2" => 0, "1-3" =>
0, "2-1" => 0, "2-2" => 0,
"2-3" => 0, "3-1" => 0, "3-2" => 0,
"3-3" => 0]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Guys:
Stuck at the mall today, and just had to crack Rails Cookbook, by
O''Reilly. It
had a recipe for accepting dynamically created forms. The recipe resolved to
build a grid on a page, and submit it with enumerable form post names.
The sample output looked like this (reconstructed):
p params[:my_form]
> ["1-1" => 0, "1-2" => 0, "1-3" =>
0, "2-1" => 0, "2-2" => 0,
"2-3" => 0, "3-1" => 0, "3-2" => 0,
"3-3" => 0]
Does anyone have the book to hand? The technical problem here is...
A> naming a form field different from its ID is bad luck
B> an HTML ID should not start with a numeral (right?)
Can someone check if the book permits this bug in the IDs? Ruby form helpers
make it kind''a easy...
--
Phlip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Sat, Jul 26, 2008 at 10:12:21PM -0700, Phlip wrote:> Stuck at the mall today, and just had to crack Rails Cookbook, by > O''Reilly. It had a recipe for accepting dynamically created forms. The > recipe resolved to build a grid on a page, and submit it with enumerable > form post names. > > The sample output looked like this (reconstructed): > > p params[:my_form] > > > ["1-1" => 0, "1-2" => 0, "1-3" => 0, "2-1" => 0, "2-2" => 0, > "2-3" => 0, "3-1" => 0, "3-2" => 0, "3-3" => 0] > > Does anyone have the book to hand? The technical problem here is... > > A> naming a form field different from its ID is bad luckWhere do you get this from? There''s nothing wrong with naming a form field something other than it''s ID, or not giving it an ID at all.> B> an HTML ID should not start with a numeral (right?)I''d have to check the HTML/XML spec, but that sounds right. Anyway, the simplest solution is to use the name prefixed with something (e.g. dynamic_) as the ID. Mind you, I suspect most browsers will happily deal with whatever string you put in the ID field, numeric or not.> Can someone check if the book permits this bug in the IDs? Ruby form > helpers make it kind''a easy...I don''t even know what you''re asking here.> Phlip--Greg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---