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 -%> _______________________ Agustin Viñao www.agustinvinao.com.ar agustinvinao (Skype) On Fri, Oct 23, 2009 at 12:28 PM, RVince <rvince99-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > 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 > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
RVince wrote:> I get a line break between the label and the text field. How do I > precent that? > > Agustin Viñao wrote: >> Use "-" at the end of the code in the view, like this: >> <%= f.label "Amount $" -%> >> <%= f.text_field :amount -%> >> _______________________ >> Agustin Viñao >> www.agustinvinao.com.ar >> agustinvinao (Skype)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. -- Posted via http://www.ruby-forum.com/.
On Fri, Oct 23, 2009 at 1:21 PM, Robert Walker <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:>>> <%= f.label "Amount $" -%> >>> <%= f.text_field :amount -%>> 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....or the LABEL or TEXTAREA (or both) being declared as a block element in the CSS. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
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, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.