Sha256: 830055bb4398accc972653c8aa65356f1813d402e4fbdf5d2cfc7a9cd67c096d
Contents?: true
Size: 999 Bytes
Versions: 3
Compression:
Stored size: 999 Bytes
Contents
module Rabl class Railtie < Rails::Railtie initializer "rabl.initialize" do |app| # Force Rails to load view templates even in API mode # Stolen shamelessly from jbuilder: https://github.com/rails/jbuilder/blob/master/lib/jbuilder/railtie.rb if Rails::VERSION::MAJOR >= 5 module ::ActionController module ApiRendering include ActionView::Rendering end end ActiveSupport.on_load :action_controller do if self == ActionController::API include ActionController::Helpers include ActionController::ImplicitRender end end end ActiveSupport.on_load(:action_view) do Rabl.register! # Inject dependency tracker for :rabl if Rails.version =~ /^[4567]/ require 'action_view/dependency_tracker' ActionView::DependencyTracker.register_tracker :rabl, Rabl::Tracker end end end end # Railtie end # Rabl
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rabl-0.16.1 | lib/rabl/railtie.rb |
rabl-0.16.0 | lib/rabl/railtie.rb |
rabl-0.15.0 | lib/rabl/railtie.rb |