这些是我的路线:
resources :auctions do
resources :bids
end
我有auctions#show
一个投标表格的观点:
= form_for [@auction, @bid] do |form|
= form.input :maximum
= form.button :submit
这当然POST
要auctions/:auction_id/bids
。
我有这个bids#create
动作:
def create
#...some_logic...
if @bid.save
#...happy_face...
else
# See Below
end
end
在这个“如果出价没有保存逻辑”中,我有:
render 'auctions/show'
这应该(并且确实)尝试渲染,app/views/auctions/show.html.erb
但我收到此错误:
Missing partial bids/info-panel, application/info-panel with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in:
* "app/views"
* "gems/devise-2.0.4/app/views"
显然这是一个问题!它正在寻找app/views/bids
而不是寻找app/views/auctions
部分。
我如何使上下文成为app/views/auctions
那些部分?