Reputation: 97
I'm creating a messageboard in Rails and have a model called Post and created one called Reply dependent on Post.
Can somebody explain the difference between the automatically created URL paths?
replies_new_path
and
new_post_path
I checked the class and controller names and Rails has done the correct pluralization of Reply. I do not understand the difference in the order. Any clues?
Upvotes: 1
Views: 35
Reputation: 3580
It's pretty straight forward - A post has_many replies (I assume), so since the post is singular but there are many replies, rails convention dictates that it's replies_new_path
and new_post_path
.
Upvotes: 3