Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ok, so current_page? doesn't work as well as it should.

  • Loading branch information...
commit dba6b2554740825f07925d4b84579647258989b4 1 parent 31c7b12
@radar authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 app/helpers/namespaced_helper.rb
View
16 app/helpers/namespaced_helper.rb
@@ -1,11 +1,13 @@
module NamespacedHelper
def selected(name)
- 'selected' if (current_page?(:controller => "admin/index") && name == "index") ||
- (current_page?(:controller => "admin/users") && name == "users" && params[:action] != "ban_ip") ||
- (current_page?(:controller => "admin/ranks") && name == "ranks") ||
- (current_page?(:controller => "admin/themes") && name == "themes") ||
- (current_page?(:controller => "admin/forums") && name == "forums") ||
- (current_page(:controller => "admin/users") && name == "ip_banning" && params[:action] == "ban_ip")
- (current_page(:controller => "moderator/moderations") && name == "moderations")
+ if (params[:controller] == "admin/index" && name == "index") ||
+ (params[:controller] == "admin/users" && name == "users" && params[:action] != "ban_ip") ||
+ (params[:controller] == "admin/ranks" && name == "ranks") ||
+ (params[:controller] == "admin/themes" && name == "themes") ||
+ (params[:controller] == "admin/forums" && name == "forums") ||
+ (params[:controller] == "admin/users" && name == "ip_banning" && params[:action] == "ban_ip")
+ (params[:controller] == "moderator/moderations" && name == "moderations")
+ 'selected'
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.