我有两个关联的表。 场地
和特价
。一个场地
可以有很多特价
。
用户创建场地后,我希望允许他们在 venues#index
页面上创建特殊场地。然而,我正在努力找出最好的方法。我厌倦了将 venue_id
作为参数发送,然后将 venue_id
作为隐藏表。通过环顾四周,我猜测 URL 结构应该类似于:venues/1/special
。 “1”是 venue_id
但我不确定如何实现这一点。
I have two associated tables. Venues
and Specials
. A venue
can have many specials
.
Once a user has created a venue I wish to allow them to create a special on the venues#index
page. However I am struggling to figure out which is the best way to do this. I am weary of sending the venue_id
as though params and then having the venue_id
as a hidden table. From looking around I'm guessing the URL structure should be something like: venues/1/special
. With '1' being the venue_id
but am unsure how to achieve this.
发布评论
评论(1)
查看嵌套资源。
Check out nested resources.