Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>link_to</code> that you provided is alright in terms of context.</p> <p>Let me tell you what it is upto:</p> <p>This is the link that you mentioned:</p> <pre><code>&lt;%= link_to "Sign-In", new_user_session_path, :class =&gt; "dropdown-toggle", :data =&gt; {:toggle=&gt;"dropdown"} %&gt; </code></pre> <p>This is the corresponding html link formed by the above link_to:</p> <pre><code>&lt;a href="users/sessions/new" class="dropdown-toggle" data-toggle="dropdown"&gt;Sign-In&lt;/a&gt; </code></pre> <p>Now consider this link:</p> <pre><code>&lt;%= link_to(raw("Sign-In" +("&lt;b class= 'caret'&gt;&lt;/b&gt;")), new_user_session_path, :class =&gt; "dropdown-toggle", :data =&gt; {:toggle=&gt;"dropdown"}) %&gt; </code></pre> <p>The above link will give you the following html link:</p> <pre><code>&lt;a class="dropdown-toggle" data-toggle="dropdown" href="users/sessions/new"&gt;Sign-In&lt;b class= 'caret'&gt;&lt;/b&gt;&lt;/a&gt; </code></pre> <p>Now you are almost close to your result. The only thing is the href.</p> <p>Ok let's modify the above <code>link_to</code> a bit with just a change in <strong>href path</strong> as-</p> <pre><code>&lt;%= link_to(raw("Sign-In" +("&lt;b class= 'caret'&gt;&lt;/b&gt;")), "#", :class =&gt; "dropdown-toggle", :data =&gt; {:toggle=&gt;"dropdown"}) %&gt; </code></pre> <p>The generated link is now equivalent to what you wanted:</p> <pre><code>&lt;a href="#" class="dropdown-toggle" data-toggle="dropdown"&gt;Sign-In&lt;b class= 'caret'&gt;&lt;/b&gt;&lt;/a&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload