これらは私のルートです:
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
これらのパーシャルのコンテキストを作成するにはどうすればよいですか?