In my web app, when I go to one of my url, angularjs returns me haml template as a plain text. But if I go to my root url it works fine. I use Rails 3.2.13, AngularJS 1.1.4, Haml for views.
This is my app/views/layouts/application.html.haml
!!! 5
%html{'ng-app' => 'myproject'}
%head
%title MyProject
= favicon_link_tag
= stylesheet_link_tag 'application'
= javascript_include_tag 'application'
= csrf_meta_tag
%body
.main-background
.app{'ng-view' => ''}
= yield
This is my app/assets/javascripts/main.js.coffee
@app = angular.module('myproject', [])
This is my app/assets/javascripts/routes.js.coffee
app.config ['$routeProvider', '$locationProvider', ($routeProvider, $locationProvider) ->
$routeProvider
.when '/',
templateUrl: '/assets/signin/index.haml',
controller: 'SignInController'
.when '/signup/:code',
templateUrl: '/assets/signup/index.haml',
controller: 'SignUpController',
]
I have 2 controllers in app/asssets/javascripts/controllers/ respectively. They both are emty. I also use html5 push state, lik this(push_state.js.coffee)
app.config ($locationProvider) ->
$locationProvider.html5Mode true
And, I have views, in app/assets/templates, whith path, that I wrote in templateUrl.
My problem is, when I go to '/', angularjs render my view fine, but, when I go to the second url, it returns me a plain text in span tag, with haml template inside it. I tried to use only one when statement with the second template and it was the same result. And, the question is what should I do to render my second view properly ?