Can I do <%=.%> interpolation without getting a <p> tag?

I have in my erb file something like this:

<%= simple_format(…) %>

The generated code is wrapped within

. In my case, I need the
code be interpolated without this wrapping. Can this be done?

Ronald

This is an effect of using the simple_format method:

"Returns text transformed into HTML
http://api.rubyonrails.org/classes/HTML.html using simple formatting
rules. Two or more consecutive newlines(\n\n) are considered as a
paragraph
and wrapped in

tags. One newline (\n) is considered as a linebreak
and
a
tag is appended. This method does not remove the newlines from
the
text.

You can pass any HTML http://api.rubyonrails.org/classes/HTML.html
attributes
into html_options. These will be added to all created paragraphs."

If you just want to print out the bare text, you can just put that in
your
erb tag: <%= my_variable %>

On Mon, Jul 7, 2014 at 10:31 AM, Ronald F. [email protected]

If you just want to print out the bare text, you can just put that in
your
erb tag: <%= my_variable %>

This didn’t work either, because the value of my_variable contains
simple quotes, and these had been replaced by an HTML entity denotation
(in this case, it is '). That’s why I thought I would need
simple_format (I was not aware that the

was coming from
simple_format … I should have known this)

Maybe I post here my code in question:

<% js_unhide_idstrings=@sequence[1…-1].map {|n| “‘tu_idiom_#{n}’”} %>

If @sequence is, say [4,1,9], the generated JavaScript code would be

var unhide_ids=['tu_idiom_1','tu_idiom_9'];

instead of

var unhide_ids=[‘tu_idiom_1’,‘tu_idiom_9’];

if you change js_unhide_idstrings.join(‘,’) to
js_unhide_idstrings.join(‘,’).html_safe
that should decode the entities.

On Mon, Jul 7, 2014 at 10:50 AM, Ronald F. [email protected]

Thanks a lot, this is the solution I was looking for!