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

haken

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haken

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Haken

A very simple gem for defining places where additional content can be injected from elsewhere.

Installation

Add this line to your Gemfile and then execute bundle install:

gem 'haken'

Usage

Define a place where additional content can be injected:

views/layouts/_navbar.html.erb

<nav>
  <%= load_view_hooks_for :navbar %>
</nav>

Then you can define a partial elsewhere(for example in a different Rails engine) and inject it into the navbar via an initializer like this:

module MyEngine
  class Engine < Rails::Engine
    initializer 'my_engine.view_hooks' do
      Haken.on_load(:navbar) { render 'layouts/my_engine/navbar_extension' }
    end
  end
end

FAQs

Package last updated on 10 Oct 2022

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