开发者

Messy &quot returned from Rails 3 controller to view

开发者 https://www.devze.com 2023-03-08 05:12 出处:网络
On my Rails 3 app controller I have the following code: array = [] Location.all.each{|x|array<<x.city.html_safe}

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:

[&quot;Littelside&quot;, &quot;Tessmouth&quot;开发者_JAVA技巧]

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 %>
0

精彩评论

暂无评论...
验证码 换一张
取 消