How to get rid of escaped characters

How do you get rid of unwanted escape characters that rails adds to a
user inputted string (e.g. like the forward slash in front of quotes,
etc.?"

Thanks,

Cheri

How do you get rid of unwanted escape characters that rails adds to a
user inputted string (e.g. like the forward slash in front of quotes,
etc.?"

Craig White wrote:

Craig White wrote:
>> How do you get rid of unwanted escape characters that rails adds to a
>> user inputted string (e.g. like the forward slash in front of quotes,
>> etc.?"
> ----
> doesn't 'h' do that?
>
> <%=h @some_array.value %>
>
> Craig

Thanks, but I want to get rid of them at the ruby level. - Cheri

Actually h (alias for html_escape) does just the reverse, sort of.

I think the OP might be a little confused since he talks about
inserting forward slashes in front of quotes. This sound like he's
looking at the string in irb which uses inspect to display values, and
string.inspect presents the string as it would appear in a ruby
literal:

irb(main):002:0> str = "\"To be or not to be\" is the beginning of
Hamlet's soliloquy"
=> "\"To be or not to be\" is the beginning of Hamlet's soliloquy"
irb(main):003:0> puts str
"To be or not to be" is the beginning of Hamlet's soliloquy
=> nil