In using form helpers, where I specify:
<%= f.label "Amount $" %> <%= f.text_field :amount %>
I get a line break between the label and the text field. How do I precent that? Thanks, Rvince
In using form helpers, where I specify:
<%= f.label "Amount $" %> <%= f.text_field :amount %>
I get a line break between the label and the text field. How do I precent that? Thanks, Rvince
Use “-” at the end of the code in the view, like this: <%= f.label “Amount $” -%> <%= f.text_field :amount -%>
...or the LABEL or TEXTAREA (or both) being declared as a block element in the CSS.
Robert Walker wrote: [...]
Wait... Do you mean that you're getting a unwanted line break in the HTML source, or on the rendered web page? <%= -%> will prevent line break characters in the underlying HTML source code, but that line break character should not generate a new line in the rendered HTML. That should require a <br /> tag.
Small nitpick: in the rendered HTML, you'd actually need a <br> tag. <br /> is XHTML syntax, and is not actually valid HTML 4.
Best,