Sha256: e61a98dadd9040d3505ad6626cf5d9c9f7b4e6b349f7d1e2b74e272718e86ba5

Contents?: true

Size: 742 Bytes

Versions: 8

Compression:

Stored size: 742 Bytes

Contents

module Marksmith
  class Engine < ::Rails::Engine
    isolate_namespace Marksmith

    initializer "marksmith.view_helpers" do
      ActiveSupport.on_load :action_view do
        require "marksmith/helper"
        ActionView::Base.include Marksmith::Helper

        module FormBuilderExtensions
          def marksmith(*args, **kwargs, &block)
            @template.marksmith_tag(*args, **kwargs.merge(form: self), &block)
          end
        end

        ActionView::Helpers::FormBuilder.include FormBuilderExtensions
      end
    end

    initializer "marksmith.assets.precompile" do |app|
      if Rails.application.config.respond_to?(:assets)
        app.config.assets.precompile << "marksmith_manifest.js"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
marksmith-0.0.13 lib/marksmith/engine.rb
marksmith-0.0.12 lib/marksmith/engine.rb
marksmith-0.0.11 lib/marksmith/engine.rb
marksmith-0.0.10 lib/marksmith/engine.rb
marksmith-0.0.9 lib/marksmith/engine.rb
marksmith-0.0.8 lib/marksmith/engine.rb
marksmith-0.0.7 lib/marksmith/engine.rb
marksmith-0.0.6 lib/marksmith/engine.rb