angularjs_scaffold
angularjs_scaffold copied to clipboard
Question: New to rails less new to angular
So far it is going well, thanks for the work on this! Just wondering how to setup a "clean" url. For example I did it that way for a home page.
pages/1 will show the Page model /home will show pages/1 since I specified in the Rail routes.rb to match '/home', to: 'pages#show', :id => '1' But I also had to go into the angular pages_controller.js.coffee to make a controller for this PagesHome = ($scope, $location, $routeParams, Page) -> Page.get id: 1 , (page) -> @original = page $scope.page = new Page(@original) PagesHome.$inject = ['$scope', '$location', '$routeParams', 'Page'];
But to do this for the About page and the Contact page seem overkill. Is there a way to do this more dynamically. Sorry if I am missing the obvious. Al
Al, I'll start learning Angular if I can ever get this generator to run! :-)
But perhaps you'd get more answers in a regular AngularJS forum? This isn't an issue with the scaffold gem???