Hi,
I am trying to figure out how to convert line breaks to html line
breaks ie <br>
The text is imput and saved as:
Which structures traverse above the annulus of Zinn?
A) Lacrimal nerve
B) Frontal nerve
C) Nasociliary nerve
D) CN IV
E) CN III
but, I have a text field in my show action view with the following:
<%= "#{@formatted_question[:question]}" %>
which produces:
Which structures traverse above the annulus of Zinn? A) Lacrimal nerve
B) Frontal nerve C) Nasociliary nerve D) CN IV E) CN III
The line breaks are still there, they just aren''t being converted to
HTML line breaks. I can see them when I view the source.
How can I get the line breaks back??
Thanks,
Dave
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/7d22b9b10c49cb35912d5238c53fe44a%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.
Got it! simple_format(text) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0b4d68e7a3fa5127c54618b6844761eb%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
> <%= "#{@formatted_question[:question].gsub(/\n/, ''<br/>'')}" %> > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/68c6ab6b-4e62-4a3f-81c6-db8755718aa4%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Oops.
<%= "#{@formatted_question[:question].gsub(/\n/,
''<br/>'').html_safe}" %>
On Wednesday, September 11, 2013 8:46:16 AM UTC-4, jsnark
wrote:>
>
> <%= "#{@formatted_question[:question].gsub(/\n/,
''<br/>'')}" %>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/5f0a91ea-85d7-432a-aefa-d1983901c422%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.