lundi 13 février 2017

Issue with select box show selected value from database in ruby

I have a ruby string like @t3= ["", "Overview", "Risks", "Scrumbler", "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.

<% @t3=@menu.menu_list.tr('"', '') %>
<% @t=@t3.tr('[]', '').split(',').map(&:to_s) %>

How can I do that?

Aucun commentaire:

Enregistrer un commentaire