ActivePath provides an interface for rendering your partials.
https://github.com/active-path/view-injection
https://github.com/active-path/path-hints
- User docs
- Specs and CI build
Add to your Gemfile:
gem 'active_path'
Add the initializer config/initializers/active_path.rb
and enable ActivePath
:
ActivePath.configure do |config|
config.enabled = true
end
Now create a subscriber where you will have access to context
, buffer
, options
, locals
and subscribe to the render_partial
event:
require 'active_path/subscribers/subscriber'
class Subscriber < ActivePath::Subscribers::Subscriber
def perform
...
end
end
ActiveSupport::Notifications.subscribe(:render_partial, Subscriber.new)
--
Feel free to submit issues or help make it better.