Formatting text in view mode same as edit mode


#1

Hi
I have a text are in my edit form as below
<%= text_area “sd_ticket”, “description”, “cols” => 80, “rows” => 5 %>

And here i am entering some text with spaces and enter keys ..Now

suppose if it has some 4 paragraphs My problem is when i try to view the
same data in view mode it is not formatted as i gave rather it shows
like its own style I dont get as much enter keys (pargraphs) as I gave
mainly. I used view code like

<%=h @sd_ticket.description %>

 What might be the reason.Please help. I tried the above without h

method ie

<%=h @sd_ticket.description %> then also no difference

Sijo


#2

<%= text_area “sd_ticket”, “description”, “cols” => 80, “rows” => 5 %>

And here i am entering some text with spaces and enter keys ..Now
<%=h @sd_ticket.description %>

#3

Hi
thanks for your reply…But one problem is pre takes enter keys Thats
ok…But suppose in edit mode suppose if I continue my typing without
pressing enter key and i gave only spaces Then alos in edit mode
everything happen ok automaticaaly each letter goes to new line when it
reaches extreme right…But in the view mode space wont be recognized by
pre …For that what should I do

Sijo


#4

Hi
Solved it with width option of pre
Sijo