Reputation: 1104
This is what I want:
class = "navbar-toggle" data-toggle = "collapse" data-target = ".navMenuCollapse"
This is what I got:
class="\"navbar-toggle\" data-toggle = \"collapse\" data-target = \".navMenuCollapse\""
This is what I tried:
<%= link_to 'test', welcome_index_path, {:class => '\"navbar-toggle\" data-toggle = \"collapse\" data-target = \".navMenuCollapse\"'} %>
Is there any opportunity to get quotes in the class-tag ? Thanks for help.
Upvotes: 1
Views: 227
Reputation: 509
Try the below code:
<%= link_to 'test', welcome_index_path, class: 'navbar-toggle', data: {toggle: 'collapse', target: '.navMenuCollapse'} %>
Upvotes: 6
Reputation: 51151
This should work:
<%= link_to 'test', welcome_index_path, :class => 'navbar-toggle', :'data-toggle' => 'collapse', :'data-target' => '.navMenuCollapse' %>
Upvotes: 1