Ruby On Rails: to Give static html from haml via the Asset Pipeline?

I need AngularJS Directive to load the template through templateUrl.

The template I want to write in haml.

Want to do something like asset_url('templates/login.html.haml') to my answer arrived-formed html.

Enable haml in sprockets, after rake assets:precompile the generated html appears in public.

But I still need:

1. To make it work in dev, without precompile

2. To find the url for dev and production which file to take

Mastodons, help me out :)
October 3rd 19 at 03:01
2 answers
October 3rd 19 at 03:03
The problem lay in the structure of directories

The file template was in the templates.
If the folder templates to transfer in javascripts, then everything starts to work as it should. Including asset_url('templates/login.html.haml')
October 3rd 19 at 03:05
In order to work in /app/assets/templates suffice to create the following initializer:
Rails.application.assets.register_mime_type 'text/html', '.html'
Rails.application.assets.register_engine '.haml', Tilt::HamlTemplate

Find more questions by tags HamlRuby on Rails