ruby on rails - Slim nested linking -
ruby on rails - Slim nested linking -
how can implement nested linking logic in slim? need html:
<a href='first_url'> <div class='some_class'> <a href='second_url'> ... </a> </div> </a>
my code
= link_to 'first_url' .some_class = link_to 'second_url' ...
but see wrong html:
<a href='first_url'></a> <div class='some_class'> <a href='first_url'></a> <a href='second_url'></a> </div>
how can prepare error? ideas?
as @ian kenny
pointed out in comment nested anchor tags not valid html instead of nesting anchor tags can utilize js magic on container element accomplish same thing:
.some_class#first-url = link_to second_anchor_path sec anchor
js:
$(document).on("click","#first-url",function(){ window.location.href = '/some_url'; });
ruby-on-rails slim
Comments
Post a Comment