O'Reilly Forums: Chapter 8 Live Edition - Adding Automation - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 8 Live Edition - Adding Automation <br /> in label_for method not rendering correctly in view

#1 User is offline   zephed56 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 06-June 10

Posted 06 June 2010 - 05:30 PM

I'm using rails 2.3.8 and ruby 1.8.6 and reading the live edition.

The following code works as far as producing both a label and a text input while only having to write one line in the view, but the less than and greater than symbols in the break tag are being converted to html character entities before they get to the browser.
CODE
def text_field(method, options={})
label_for(method, options) + super(method, options)
end
private

def label_for(method, options={})
label(options.delete(:label) || method) + "<br />"
end



My html output therefore looks like this:
Name<br /> [the input box is here]

That <br /> does not turn into a line break.

Any help? The following section with the wrap_field methods does the same thing, the div's and spans display as text.
0

#2 User is offline   simonstl 

  • Active Member
  • PipPip
  • Group: O'Reilly Editor
  • Posts: 35
  • Joined: 17-September 08

Posted 07 June 2010 - 05:35 PM

Sorry for the delay - I was travelling to, of all things, RailsConf.

My bet is that something broke in the major round of bug fixing between 2.3.5 and 2.3.8, but I'll need to make that update on a better network than I have at the moment. I've been focusing on 3.0 a little too squarely!

I'll try to have a real answer to you tomorrow.
0

#3 User is offline   zephed56 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 06-June 10

Posted 07 June 2010 - 07:01 PM

Take your time, no rush.

Thanks!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users