path以及嵌套path

Path-Method

Requeseted Action

Path

Http verb

posts_path

index

/posts

GET

post_path(1)

show

/posts/1

GET

new_post_path

new

/posts/new

GET

edit_post_path(1)

edit

/posts/1/edit

GET

posts_path

create

/posts

POST

post_path(1)

update

/posts/1

PUT

post_path(1)

destroy

/posts/1

DELETE

 

 

Path-Method

Requeseted Action

Path

Http verb

posts_path

index

/posts

GET

post_comments_path(post)

index

/posts/1/comments

GET

post_path(1)

show

/posts/1

GET

post_comments_path([@post, comment])
ó [@post, comment]

show

/posts/1/comments/1

GET

new_post_path

new

/posts/new

GET

new_post_comment_path(@post)

new

/posts/1/comments/new

GET

edit_post_path(1)

edit

/posts/1/edit

GET

edit_post_comment_path(@post, comment)
ó [:edit, @post, comment]

edit

/posts/1/comments/1/edit

GET

你可能感兴趣的:(Path)