<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-06-11T23:38:16+01:00</created-at>
  <creator-id type="integer">21928</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">395</number>
  <permalink>link_to_tagged_current</permalink>
  <priority type="integer">16324</priority>
  <project-id type="integer">8994</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>invalid</state>
  <tag>enhancement patch tested</tag>
  <title>link_to_tagged_current</title>
  <updated-at type="datetime">2008-06-12T10:12:45+01:00</updated-at>
  <user-id type="integer">1366</user-id>
  <user-name>Pratik</user-name>
  <creator-name>Ary Djmal</creator-name>
  <url>http://rails.lighthouseapp.com/projects/8994/tickets/395</url>
  <original-body>This patch adds a url helper that allows you to create a link, adding the class &quot;current&quot; when in the current page.

I've found me using this helper much more than link_to_unless_current. I think it makes sense to push it to rails.

== Examples

Let's say you have a navigation menu...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;Home&quot;, { :action =&gt; &quot;index&quot; }) %&gt;&lt;/li&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;About Us&quot;, { :action =&gt; &quot;about&quot; }) %&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

If in the &quot;about&quot; action, it will render...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot; class=&quot;current&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

...but if in the &quot;index&quot; action, it will render:

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot; class=&quot;current&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@</original-body>
  <latest-body>This patch adds a url helper that allows you to create a link, adding the class &quot;current&quot; when in the current page.

I've found me using this helper much more than link_to_unless_current. I think it makes sense to push it to rails.

== Examples

Let's say you have a navigation menu...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;Home&quot;, { :action =&gt; &quot;index&quot; }) %&gt;&lt;/li&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;About Us&quot;, { :action =&gt; &quot;about&quot; }) %&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

If in the &quot;about&quot; action, it will render...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot; class=&quot;current&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

...but if in the &quot;index&quot; action, it will render:

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot; class=&quot;current&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
This patch adds a url helper that allows you to create a link, adding the class &quot;current&quot; when in the current page.
&lt;/p&gt;&lt;p&gt;
I've found me using this helper much more than link_to_unless_current. I think it makes sense to push it to rails.
&lt;/p&gt;&lt;p&gt;
== Examples
&lt;/p&gt;&lt;p&gt;
Let's say you have a navigation menu...
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;%= link_to_tagged_current(&amp;quot;Home&amp;quot;, { :action =&amp;gt; &amp;quot;index&amp;quot; }) %&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;%= link_to_tagged_current(&amp;quot;About Us&amp;quot;, { :action =&amp;gt; &amp;quot;about&amp;quot; }) %&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
If in the &quot;about&quot; action, it will render...
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/index&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/about&amp;quot; class=&amp;quot;current&amp;quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
...but if in the &quot;index&quot; action, it will render:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/index&amp;quot; class=&amp;quot;current&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/about&amp;quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>This patch adds a url helper that allows you to create a link, adding the class &quot;current&quot; when in the current page.

I've found myself using this helper much more than link_to_unless_current. And because almost every site has some sort of tabbed navigation, I think it makes sense to push it to rails.

== Examples

Let's say you have a navigation menu...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;Home&quot;, { :action =&gt; &quot;index&quot; }) %&gt;&lt;/li&gt;
  &lt;li&gt;&lt;%= link_to_tagged_current(&quot;About Us&quot;, { :action =&gt; &quot;about&quot; }) %&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

If in the &quot;about&quot; action, it will render...

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot; class=&quot;current&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@

...but if in the &quot;index&quot; action, it will render:

@@@ html
&lt;ul id=&quot;navbar&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/index&quot; class=&quot;current&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/controller/about&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;
This patch adds a url helper that allows you to create a link, adding the class &quot;current&quot; when in the current page.
&lt;/p&gt;&lt;p&gt;
I've found myself using this helper much more than link_to_unless_current. And because almost every site has some sort of tabbed navigation, I think it makes sense to push it to rails.
&lt;/p&gt;&lt;p&gt;
== Examples
&lt;/p&gt;&lt;p&gt;
Let's say you have a navigation menu...
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;%= link_to_tagged_current(&amp;quot;Home&amp;quot;, { :action =&amp;gt; &amp;quot;index&amp;quot; }) %&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;%= link_to_tagged_current(&amp;quot;About Us&amp;quot;, { :action =&amp;gt; &amp;quot;about&amp;quot; }) %&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
If in the &quot;about&quot; action, it will render...
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/index&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/about&amp;quot; class=&amp;quot;current&amp;quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
...but if in the &quot;index&quot; action, it will render:
&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;navbar&amp;quot;&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/index&amp;quot; class=&amp;quot;current&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/controller/about&amp;quot;&amp;gt;About Us&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-06-11T23:45:59+01:00</created-at>
      <creator-id type="integer">21928</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">395</number>
      <permalink>link_to_tagged_current</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>link_to_tagged_current</title>
      <updated-at type="datetime">2008-06-11T23:45:59+01:00</updated-at>
      <user-id type="integer">21928</user-id>
      <user-name>Ary Djmal</user-name>
      <creator-name>Ary Djmal</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/395</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I think this should stay plugin for now. You can also try to email core mailing list to see what other people think.

Thanks.</body>
      <body-html>&lt;div&gt;&lt;p&gt;
I think this should stay plugin for now. You can also try to email core mailing list to see what other people think.
&lt;/p&gt;&lt;p&gt;
Thanks.
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-06-12T10:12:45+01:00</created-at>
      <creator-id type="integer">21928</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">395</number>
      <permalink>link_to_tagged_current</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>invalid</state>
      <tag nil="true"></tag>
      <title>link_to_tagged_current</title>
      <updated-at type="datetime">2008-06-12T10:12:45+01:00</updated-at>
      <user-id type="integer">1366</user-id>
      <user-name>Pratik</user-name>
      <creator-name>Ary Djmal</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/395</url>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>25b4fa1e057039fc6f1586ba19c98419424bc312</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-06-11T23:38:17+01:00</created-at>
      <filename>link_to_tagged_current.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">27024</id>
      <size type="integer">4354</size>
      <uploader-id type="integer">21928</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/27024/link_to_tagged_current.diff</url>
    </attachment>
  </attachments>
</ticket>
