Sha256: 6c6dea14eedd93c34d244ab0145ea07f8807a0a9e6c3bfe08cec833f52abe4d7

Contents?: true

Size: 1.13 KB

Versions: 20

Compression:

Stored size: 1.13 KB

Contents

module Refinery
  module <%= namespacing %>
    class Engine < Rails::Engine
      include Refinery::Engine
      isolate_namespace Refinery::<%= namespacing %>

      engine_name :refinery_<%= extension_plural_name %>

      initializer "register refinerycms_<%= plural_name %> plugin" do
        Refinery::Plugin.register do |plugin|
          plugin.name = "<%= plural_name %>"
          plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.<%= namespacing.underscore %>_admin_<%= plural_name %>_path }
          plugin.pathname = root
          plugin.activity = {
            :class_name => :'refinery/<%= namespacing.underscore %>/<%= singular_name %>'<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? and title.name != 'title' %>,
            :title => '<%= title.name %>'<% end %>
          }
          <% unless namespacing.underscore == plural_name -%>plugin.menu_match = %r{refinery/<%= namespacing.underscore %>/<%= plural_name %>(/.*)?$}<% end %>
        end
      end

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

Version data entries

20 entries across 10 versions & 1 rubygems

Version Path
refinerycms-core-2.0.10 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.10 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.9 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.9 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.8 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.8 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.7 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.7 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.6 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.6 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb
refinerycms-core-2.0.5 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.5 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.4 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.4 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.3 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.3 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.2 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.2 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.1 lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb
refinerycms-core-2.0.1 lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb