Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: New to rails less new to angular #17

Open
alnutile opened this issue Apr 29, 2013 · 1 comment
Open

Question: New to rails less new to angular #17

alnutile opened this issue Apr 29, 2013 · 1 comment

Comments

@alnutile
Copy link

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

@EdJones
Copy link

EdJones commented Apr 29, 2013

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???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants