I’ve passed a field from my database, into my controller, so @download has a value of /link1, /link2, link3 I need to display all three links in my view. I’ve tried the following code:
%ul.pdf
- ["#{@download}"]. each do|li|
%li= link_to "title", "#{ li }"
but this just shows one hyperlink with the value of all three links in one. Is there any way i can get it to split at each comma or something?
Yes, you can split at the comma (this accounts for whitespace following the comma too).
or, as a whole
though you might consider doing the
splitin the controller on@downloaddepending on the context.