Sha256: 5af224246cb285e3d008e4fd601fb3cb0d40871352740833ac68fa3a9fc6bfe9
Contents?: true
Size: 1023 Bytes
Versions: 5
Compression:
Stored size: 1023 Bytes
Contents
require "rbexy/rails" module Rbexy module Rails class Engine < ::Rails::Engine initializer "rbexy" do |app| template_handler = ::Rails.version.to_f >= 6.0 ? proc { |template, source| Rbexy.compile(source) } : proc { |template| Rbexy.compile(template.source) } ActionView::Template.register_template_handler(:rbx, template_handler) ActiveSupport.on_load :action_controller_base do helper Rbexy::ViewContextHelper helper_method :rbexy_component_provider include ControllerHelper end if defined?(ViewComponent) ViewComponent::Base.include Rbexy::ViewContextHelper end Rbexy.configure do |config| require "rbexy/component_providers/rbexy_provider" config.component_provider = Rbexy::ComponentProviders::RbexyProvider.new config.template_paths << ::Rails.root.join("app", "components") config.enable_context = true end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems