Sha256: ab9a428c485c0c8fe2369053bfb93616349c1d7ef2ae8ed992aaef22db88caf1

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

module Answers
  module <%= namespacing %>
    class Engine < Rails::Engine
      extend Answers::Engine
      isolate_namespace Answers::<%= namespacing %>

      engine_name :answers_<%= extension_plural_name %>

      before_inclusion do
        Answers::Plugin.register do |plugin|
          plugin.name = "<%= plural_name %>"
          plugin.url = proc { Answers::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
          plugin.pathname = root
          <% unless namespacing.underscore == plural_name -%>plugin.menu_match = %r{answers/<%= namespacing.underscore %>/<%= plural_name %>(/.*)?$}<% end %>
        end
      end

      config.after_initialize do
        Answers.register_extension(Answers::<%= class_name.pluralize %>)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
answers-core-0.0.0.2 lib/generators/answers/engine/templates/lib/answers/plural_name/engine.rb.erb
answers-core-0.0.0 lib/generators/answers/engine/templates/lib/answers/plural_name/engine.rb.erb