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

path_to for routes with optional parameters doesn't work #16

Closed
Unitech opened this issue Jan 24, 2013 · 1 comment
Closed

path_to for routes with optional parameters doesn't work #16

Unitech opened this issue Jan 24, 2013 · 1 comment

Comments

@Unitech
Copy link

Unitech commented Jan 24, 2013

By defining

map.get('/test/:p1?', 'home#test');

When I use path_to

map.pathTo.test()
// I get ''
map.pathTo.test('param1')
// I get '/test/param1?'

A cool feature would be to declare route parameters like that :

map.get('/test/:p1/:p2?', 'home#test');

And to map them like that :

map.pathTo.test({p1 : 'param1', p2 : 'param2'})

Anyway thanks for this very nice piece of code

1602 added a commit that referenced this issue Jan 24, 2013
1602 added a commit that referenced this issue Jan 24, 2013
@1602 1602 closed this as completed in e808060 Jan 24, 2013
1602 added a commit that referenced this issue Jan 24, 2013
@1602
Copy link
Owner

1602 commented Jan 24, 2013

Thanks for spotting issue and nice api suggestion. Everything available in updated npm package (v0.0.8-4)

@Asp3ctus Asp3ctus mentioned this issue Feb 3, 2013
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