app/controllers/administrate/application_controller.rb in administrate-0.0.8 vs app/controllers/administrate/application_controller.rb in administrate-0.0.9

- old
+ new

@@ -1,11 +1,5 @@ -require "administrate/namespace" -require "administrate/page/form" -require "administrate/page/table" -require "administrate/page/show" -require "administrate/resource_resolver" - module Administrate class ApplicationController < ActionController::Base def index @resources = resource_class.all @page = Administrate::Page::Table.new(dashboard) @@ -63,13 +57,15 @@ redirect_to action: :index end private - helper_method :link_class - def link_class(resource) + helper_method :nav_link_state + def nav_link_state(resource) if resource_name.to_s.pluralize == resource.to_s :active + else + :inactive end end def dashboard @dashboard ||= resource_resolver.dashboard_class.new