Search code examples
rubyruby-on-rails-3redmine-plugins

Issue with select box show selected value from database in ruby


I have a ruby string like

@t3= ["", "Overview", "<span>Risks</span>", "<span>Scrumbler</span>", "Roadmap"]

return from the database i want to get it into the array but it doesnot get it as array

I try to dp the following but it doesnot work.

<% @[email protected]('[]', '').split(',').map(&:to_s) %>

How can I do that?


Solution

  • Yes I solved it by using.

    <% @[email protected]('[]', '').split(',').map! {|item| item.to_s.strip } %>
    

    Thanks