Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phcdevworks_active_menus

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phcdevworks_active_menus

  • 4.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

PHCDevworks Active Menus for Rails 7 (Add Active Class to Menus)

PHCDevworks Active Menus Rails 7 engine with helpers to add active class to menus.

  • Easily add an active class to menu items based on the current controller.
  • Effortlessly add an active class to menu items based on the current action.
  • Seamlessly add an active class to menu items based on both the current controller and current action.
Step 1 - Add PHCDevworks Active Menus to your gemfile
gem 'phcdevworks_active_menus'
bundle install
Step 2 - Load Helpers in the Application's Controller

Add the line of code below into your app/controllers/application_controller.rb (application's controller file).

helper PhcdevworksActiveMenus::Engine.helpers
How to Add Active Class Based on Controller Only (Often used for main menu items with sub-menus.)

Add the line of code in between div class tag.

<div class"<%= phc_menu_active_controller("ExampleControllerName") %>">
How to Add Active Class Based on Action Only (Often used for submenu items.)

Add the line of code in between div class tag.

<div class"<%= phc_menu_active_action("ExampleActionName") %>">
How to Add Active Class Based on Controller and Action (Used if you need to get specific.)

Add the line of code in between div class tag.

<div class"<%= phc_menu_active_action_controller("ExampleControllerName", "ExampleActionName") %>">

Status

Gem Version Publish to Github.com Publish to Rubygems.org

FAQs

Package last updated on 27 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc