views:

24

answers:

1

Hi, I've got the following controller

def detail
    @book = get_book_details(params[:asin])

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @booklists }
    end
end

the unbundle lib get_book_details(asin), return a "book = Hash.new" like this:

book[:title]
book[:editorial_reviews] 
book[:total_reviews] 
...

and so on. In the view, I get the following

<%= h @book[:editorial_reviews]%>

The problem is that the content of @book[:editorial_reviews] is actually an HTML

substring, containing some fews tags I'd like to render.

Like that, I'll get those tags into the client browser view, but not interpreted and

sanitizing the string, result in missing some formatting layout which I'd like to

display instead.

How can I make the view render that inside html tags ???

Sorry for the newbie question. Thanks in advance lgs

+1  A: 

The h method escapes all the html tags. If you remove it, your html tags won't be escaped.
And you'll have your content appropriately formatted.

<%= @book[:editorial_reviews] %>
Damien MATHIEU
... and you'r right, Thank You So Much. I could not see that and it was driving me mad !!!bye lgs
lgs
Then mark my answer as the solution to your question (there's a "V" link at the left of it for that) ;)
Damien MATHIEU