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

api broken #18

Closed
Asp3ctus opened this issue Feb 3, 2013 · 0 comments
Closed

api broken #18

Asp3ctus opened this issue Feb 3, 2013 · 0 comments

Comments

@Asp3ctus
Copy link

Asp3ctus commented Feb 3, 2013

after your commits to close #16
a few bugs are introdused to break the app again :)

nested routes in compund:

map.resources 'users', (usesr)->
    uses.resources 'posts', (posts)->
                posts.post 'rate.:format?', 'posts#rate'

it used to be

user = {id : 4}
post = {id: 2}
pathTo.user_post( user, post) to create /users/4/posts/2 
pathTo.user_post( 4, 2) to create /users/4/posts/2 
pathTo.user_post_rate( 4, 2) to create /users/4/posts/2/rate 

now it is:

pathTo.user_post( user, post) creates /users/4/posts/4 
pathTo.user_post( 4, 2) creates /users/4/posts/2 
pathTo.user_post_rate( 4, 2) creates /users/4/posts/2/rate
pathTo.user_post_rate( user, post) creates /users/4/posts/2/rate
pathTo.user_post_rate( {user_id: user.id, id : post.id}) creates /users/4/posts/undefined/rate

but i guess you wanted:

pathTo.user_post( {user_id: user.id, id : post.id}) to create /users/4/posts/4 

the problem is that API is not same now
and OLD code is broken .....
i think both methods should work
i like the idea to pass the object to pathTo method, but alse some times it is much better to pass each param separatly

@1602 1602 closed this as completed in a4c58dc Feb 5, 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