Skip to content

Question: New to rails less new to angular #17

@alnutile

Description

@alnutile

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions