[Ruby] ruby on rails, formatting check_box
Frank Schwieterman
fschwiet at gmail.com
Thu Aug 2 00:33:05 PDT 2007
I tried dave's suggestoin (<label><%= checkbox>text</label>) and it does
what I had hoped. I'm interested in trying the CSS approaches too, but I'm
not sure how to add CSS to the <%= checkbox %>. I could bind the CSS to the
element type, but then it would affect all element types. I could bind it
to the element id, but then I'd be putting a dependency on the form helper's
conventions for making up those names (which could change). I could bind it
to the class name, but I don't know how to cause the <%= checkbox %> to have
a particular class name.
On 8/1/07, shane becker <veganstraightedge at gmail.com> wrote:
>
>
> > Usually, it's best to wrap your input with the label, so:
> > <label for='content_segment_needs_review'>
> > <input id='content_segment_needs_review' name='content_segment
> > [needs_review]' type='checkbox' value='1' />
> > Needs review
> > </label>
>
> i don't think that's the way it goes. i'm pretty sure it goes like this:
> <label for="your_face">Label</label>
> <input id="your_face" name='your_mother[your_face]' value='1' />
>
> http://www.w3schools.com/tags/tag_label.asp
>
>
> > To get line breaks to handle the way you want you, might try using
> > some CSS,
> > specifically: label{ white-space: nowrap }. Might work. Haven't
> > tried it.
>
> white-space is a goofy attribute. i would give these two a try.
> { display: inline }
> { display: block }
>
>
> good luck.
> -shaners
>
>
>
>
>
> -----------
> join the resistance. fall in love.
> http://theresistancearmy.com
>
>
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
>
More information about the Ruby
mailing list