openstreetmap as link

18 views
Skip to first unread message

Melb01

unread,
Aug 15, 2014, 3:46:31 AM8/15/14
to rubyonra...@googlegroups.com
Hi,
I am using openlayers gem to show a openstreetmap as div in a a rails app
how can I make this div as a link to an other page  in the rails app using link_to tag


regards

Eric Saupe

unread,
Aug 15, 2014, 11:41:41 AM8/15/14
to rubyonra...@googlegroups.com
<%= link_to('my_link') do %>
  <div>OPEN STREETMAP CONTENT</div>
<% end %>
You can put a div inside of the <a> generated by link_to and this will work for you but putting block elements inside of <a> is not really good practice. Instead you could try <span> instead of <div>
Reply all
Reply to author
Forward
0 new messages