After removing the '#' symbol in angular by using html5Mode, everything seemed to work fine. However, upon refreshing the page, it started looking for the template in Rails instead of Angular, resulting in a "template not found" error.
Angular Route
app.config([
"$stateProvider", "$urlRouterProvider","$locationProvider",
function ($stateProvider, $urlRouterProvider, $locationProvider) {
// Angular route configurations here
}
]);
Rails Route
Rails.application.routes.draw do
# Rails route configurations here
end
In addition, the base in application.html.erb
has been set to <base href="/">
.
The issue arises when attempting to refresh pages such as http://localhost:3000/search
while utilizing html5mode in Angular routes. However, without html5mode, everything functions properly. Is there a correct solution for this problem? What would be the recommended approach?