On my Rails 3 app controller I have the following code:
array = []
Location.all.each{|x|array<<x.city.html_safe}
@data_dump = array
In the Rails console it looks nice and clean:
["Littelside", "Tessmouth"]
In my view the @data_dump object gets encoded:
["Littelside", "Tessmouth"]
How do you clean this mess up? I want my object in view, to return as the object does in terminal. Thanks in advance!
What about:
<%=raw @data_dump %>
来源:https://stackoverflow.com/questions/6131347/messy-quot-returned-from-rails-3-controller-to-view