I've got angular ng-repeat in Ruby .erb view.
Now, I need to make a link_to to a page, dedicated to some IP address.
First I tried
<td><%= link_to '{{ roll.system }}' ,'server/'+'{{ roll.system }}' %></a></td>,
where {{roll.system}} is angular.js variable containing the ip.
Overall path would be like localhost/server/127.0.0.1 and would not work because of the dots in IP address. Now, I am trying to make a hash out of IP address, and then decode it after routing is done.
My current code is:
<td><%= link_to '{{ roll.system }}' ,"server/"+Base64.urlsafe_encode64('{{ roll.system }} %></a></td>
Here's the problem. Base64 encodes the string as it is, creating a hash of literal string '{{ roll.system }}'. I need it to look up the value it refers to in angular variable.
I don't get why is it a problem since link_to works fine.
Please no design advices a-la 'rewrite your app from scratch'.