Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Ability to customize path exclusions #19

Closed
wants to merge 1 commit into from
Closed

Ability to customize path exclusions #19

wants to merge 1 commit into from

Conversation

sandstrom
Copy link

An alternative would be this (which also makes it possible to remove the default exclusion, "templates"):

def template_path(path)
  path = path.split('/')
  exclusions = Array.wrap(Rails.configuration.rasputin.path_exclusions)
  path.reject! { |name| exclusions.include?(name) }
  path.join(Rails.configuration.rasputin.template_name_separator)
end


class Engine < ::Rails::Engine
  config.rasputin = ActiveSupport::OrderedOptions.new
  config.rasputin.precompile_handlebars = Rails.env.production?
  config.rasputin.template_name_separator = '/'
  config.rasputin.path_exclusions = ["templates"]

  config.rasputin.use_javascript_require = true
  config.rasputin.strip_javascript_require = true

  initializer :setup_rasputin, :group => :all do |app|
    app.assets.register_preprocessor 'application/javascript', Rasputin::RequirePreprocessor
    app.assets.register_engine '.handlebars', Rasputin::HandlebarsTemplate
    app.assets.register_engine '.hbs', Rasputin::HandlebarsTemplate
  end
end

@tchak
Copy link
Owner

tchak commented Apr 13, 2012

Thank's!

I am currently porting most of the work don in rasputin to the official ember-rails
A similar issue poped there : emberjs/ember-rails#34

I will try to look in to it this week-end and will fix this in both projects

@tchak tchak closed this Nov 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants