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

Needs automatic view helpers for resources #7

Open
hunterloftis opened this issue Mar 4, 2012 · 2 comments
Open

Needs automatic view helpers for resources #7

hunterloftis opened this issue Mar 4, 2012 · 2 comments

Comments

@hunterloftis
Copy link
Contributor

Not sure about the best API for this, consider these:

routes.js:

app.resource('users'); 

view.jade:

resource_uri('users', 'create');
resource_url('users', 'show', 'uuid')

or maybe, since app is already injected into the view:

app.controllers.users.create.url()
app.controllers.users.show.url('uuid')

app.controllers.users.url() // generic "/users" so you can concat custom routes to the end
@hunterloftis
Copy link
Contributor Author

First, express-resource will need to be updated to work with Express 3. Or rewritten since express-resource is kind of hacky.

@dbecher
Copy link

dbecher commented Mar 5, 2012

Definitely prefer the resource_uri('users', 'create'); version in the views. Although it could be implemented with the .url() convention, which I also like.

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

No branches or pull requests

2 participants