【发布时间】:2017-02-01 14:09:49
【问题描述】:
我有两个模型,Carousel 和 Item,它们的关系是多对多的。
在 routes.rb 中:
resources :carousels do
resources :items
end
我正在尝试在我的轮播索引中以模式呈现带有枚举器参数(类型)的新项目模板。
渲染代码:
render new_carousel_item_path(caroulsel), type: "image"
但是我遇到了以下问题:
ActionView::MissingTemplate at /carousels
Missing partial carousels/1/items/_new with {:locale=>[:"pt-BR"], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :slim, :coffee]}
有什么想法吗?
【问题讨论】:
-
当你说渲染轨道会尝试找到部分。
-
或者你可以传递模板
标签: ruby-on-rails ruby ruby-on-rails-4