Forum: Ruby on Rails disable link to current page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Peter M. (Guest)
on 2006-03-09 03:22
(Received via mailing list)
Hi,

When writing a .rhtml file how can i detect which url is being
rendered and disable the links? Even more, I may want to change some
other css classes for other elements based on which url is the current
one.

Thanks,
Peter
Ben M. (Guest)
on 2006-03-09 08:36
(Received via mailing list)
Peter M. wrote:
> Hi,
>
> When writing a .rhtml file how can i detect which url is being
> rendered and disable the links? Even more, I may want to change some
> other css classes for other elements based on which url is the current
> one.

Check out link_to_unless_current and request.request_uri.

b
This topic is locked and can not be replied to.