Hey Shalon. Thanks for reviewing the commit. I've fixed the errors you mentioned, and cleaned up all the helper specs to spec out having id= attributes set for unbound form elements when a name is present.
Here is the commit: http://github.com/merbjedi/merb/commit/96e3fde9e5c62973e560cbcd310981c25b640cc7 This seems to be handling id attributes properly on unbound form controls. Also, can you suggest some additional text cases. I believe the specs on form helpers are a bit too simple, and don't check complicated cases like [] names, etc. The bound controls are well speced and haven't been changed, however the unbound controls seem to be suffering from a lack of specs. If you can come up with half a dozen or so fairly complex unbound form examples, that would help out greatly. You can use my github repo directly, or just post the examples via gist or email. Thanks On Feb 5, 8:35 am, Shalon Wood <[email protected]> wrote: > If I try to use your branch, I get an error if I use a symbol for the > name of the field: > > undefined method `snake_case' for :short_title:Symbol - (NoMethodError) > > If unbound forms have to use strings for the name, the documentation > needs to be updated or there will be confusion.... > > Shalon Wood > > > > Jacques Crocker <[email protected]> writes: > > I made a couple checkins on my up to date 1.0.x merb fork: > > > Adds some useful specs to better verify label functionality on form > > helpers > >http://github.com/merbjedi/merb/commit/19c2e92706b3ab927d420b34982179... > > > Adds extensive specs for all unbound and bound form helpers to verify > > label functionality works correctly. Also includes the fix to merb- > > helpers to make all the specs pass. > >http://github.com/merbjedi/merb/commit/368fb706c969aef574fd921602118a... > > > Please review and let me know if I missed anything. I think this > > should help greatly stabalize the label functionality on the form > > helpers by spec'ing it on all the scenarios. > > > Thanks > > > On Feb 4, 1:47 pm, Yehuda Katz <[email protected]> wrote: > >> The class="text" et al is because there's no other way to style a text box > >> in IE6. In IE7+ you can do input[type=text], but for IE6 the attribute > >> selector doesn't exist, so we make all input[type=text] also respond to > >> input.text. > > >> -- Yehuda > > >> On Wed, Feb 4, 2009 at 1:46 PM, Michael D'Auria > >> <[email protected]>wrote: > > >> > To add to this, the documentation does not mention that a class will > >> > automatically be appended. This is something that i personally patched a > >> > while back and i see that it has resurfaced again. Is there a reason why > >> > merb forces a class attribute? > > >> > Michael > > >> > On Wed, Feb 4, 2009 at 3:07 PM, Jacques Crocker > >> > <[email protected]>wrote: > > >> >> I fixed the label issue (for attr missing) a little while back (via > >> >> 1.0.6) on bound form elements, but I may have broke it for unbound > >> >> form elements. > > >> >> Anyways, here are some form helper spec updates that repro the issue > > >> >>http://github.com/merbjedi/merb/commit/19c2e92706b3ab927d420b34982179... > > >> >> If you don't get around to it, I should be able to provide a patch for > >> >> this issue tonight. Be another good one to get fixed for 1.0.9 > > >> >> Thanks > > >> >> On Feb 4, 11:45 am, Yehuda Katz <[email protected]> wrote: > >> >> > I saw this as well in an app I'm working on. There appears to have > >> >> > been > >> >> a > >> >> > regression with for=. I need to fix this for my own app :) > > >> >> > -- Yehuda > > >> >> > On Wed, Feb 4, 2009 at 11:43 AM, Shalon Wood <[email protected]> wrote: > > >> >> > > No difference. > > >> >> > > <p><%= text_field :name => 'title', :label => "Title" %></p> > > >> >> > > produces > > >> >> > > <p><label>Title</label><input type="text" class="text" > >> >> name="title"></p> > > >> >> > > (And the example in the documentation is > >> >> > > <%= text_field :name => :fav_color, :label => "Your Favorite Color" > >> >> > > %> > >> >> > > # => <label for="fav_color">Your Favorite Color</label><input > >> >> type="text" > >> >> > > id="fav_color" name="fav_color" /> > >> >> > > ) > > >> >> > > Shalon Wood > > >> >> > > Tony Mann <[email protected]> writes: > > >> >> > > > You might want to try making :name a string, and a not a > >> >> > > > symbol. > > >> >> > > > ..tony.. > >> >> > > > On Wed, Feb 4, 2009 at 11:30 AM, Shalon Wood <[email protected]> > >> >> wrote: > > >> >> > > > According to the documentation for #text_field, this: > >> >> > > > <%= text_field :name => :title, :label => "Title" %> > >> >> > > > should generate > >> >> > > > <label for="title">Title</label><input type="text" id="title" > >> >> > > > name="title"> > >> >> > > > However, what I'm seeing is this: > >> >> > > > <p><%= text_field :name => :title, :label => "Title" %></p> > >> >> > > > <p><%= text_field :name => :short_title, :label => "Short > >> >> title" > >> >> > > > %></p> > >> >> > > > <p><%= text_field :name => :file_prefix, :label => "File > >> >> prefix" > >> >> > > > %></p> > >> >> > > > <p><%= text_field :name => :keywords, :label => "Keywords" > >> >> %></p> > >> >> > > > <p><%= text_area :name => :on_release, :rows => 5, :label => > >> >> > > > "Scripts to > >> >> > > > run on release" %></p> > >> >> > > > <p><%= select :name => :universe_id, :label => "Universe", > >> >> > > > :collection > >> >> > > > => @authinfo[:user].universes, :text_method => :name, > >> >> :value_method > >> >> > > > => > >> >> > > > :id %> > >> >> > > > <p><%= text_area :name => :description, :label => > >> >> > > > "Description" > >> >> > > > %></p> > >> >> > > > <%= hidden_field :name => :flag %> > >> >> > > > yields: > >> >> > > > <p><label>Title</label><input type="text" class="text" > >> >> > > > name="title"></p> > >> >> > > > <p><label>Short title</label><input type="text" class="text" > >> >> > > > name="short_title"></p> > >> >> > > > <p><label>File prefix</label><input type="text" class="text" > >> >> > > > name="file_prefix"></p> > >> >> > > > <p><label>Keywords</label><input type="text" class="text" > >> >> > > > name="keywords"></p> > >> >> > > > <p><textarea label="Scripts to run on release" rows="5" > >> >> > > > name="on_release"></textarea></p> > >> >> > > > <p><label>Universe</label><select > >> >> name="universe_id"></select></p> > >> >> > > > <p><textarea label="Description" > >> >> name="description"></textarea></p> > >> >> > > > <input type="hidden" class="hidden" name="flag"> > >> >> > > > Anyone know why? > >> >> > > > Shalon Wood > >> >> > > > -- > > >> >> > > -- > > >> >> > -- > >> >> > Yehuda Katz > >> >> > Developer | Engine Yard > >> >> > (ph) 718.877.1325 > > >> -- > >> Yehuda Katz > >> Developer | Engine Yard > >> (ph) 718.877.1325 > > -- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" 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/merb?hl=en -~----------~----~----~----~------~----~------~--~---
