Reputation: 4857
I don't understand this output. I have this
<%= link_to(:class=>"dropdown-toggle", "data-toggle"=> "dropdown") do %>
<%= content_tag(:span, :class=>"hidden-xs-only") do %>
<%= link_to("Sign Up", new_user_registration_path) %>
<% end %>
<% end%>
but it outputs this
<a class="dropdown-toggle" data-toggle="dropdown">
<span class="hidden-xs-only">
</span>
</a>
<a href="/users/sign_up">Sign Up</a>
Upvotes: 0
Views: 41
Reputation: 135227
Sorry, nesting <a>
tags is not valid HTML.
Use a <ul>
or <div>
for the outer element
You'd have to use javascript to toggle the child elements anyway, so yes, just add an onclick
listener with a function that displays/hides the dropdown
Upvotes: 1