I have in my application.rb configuration changes to use an alternative file extension like hbs. However it seems like the renderer is registered before this change is made. Maybe I am doing things in the wrong order, however my workaround is to re-register the handlebars renderer after I've updated the extension.
ShtRails.template_extension = 'hbs'
ShtRails.action_view_key = 'hbs'
ShtRails.template_namespace = 'HighlyHBS'
ShtRails.template_base_path = Rails.root.join("app", "views")
# need to re-register the handler
ActiveSupport.on_load(:action_view) do
ActionView::Template.register_template_handler(::ShtRails.template_extension.to_sym, ::ShtRails::Handlebars)
end
I have in my application.rb configuration changes to use an alternative file extension like
hbs
. However it seems like the renderer is registered before this change is made. Maybe I am doing things in the wrong order, however my workaround is to re-register the handlebars renderer after I've updated the extension.That last bit is just copied from the sht source: https://github.com/railsware/sht_rails/blob/e52ab72b3e5eef0794787485edcac188a4812a49/lib/sht_rails/handlebars.rb#L39