3

I have two models, Carousel and Item, their relation is many to many.

In routes.rb:

resources :carousels do
  resources :items
end

I'm trying to render new items template with an enumerator param(type) in a modal in my carousel index.

Render code:

render new_carousel_item_path(caroulsel), type: "image"

But I'm having the following issue:

ActionView::MissingTemplate at /carousels
Missing partial carousels/1/items/_new with {:locale=>[:"pt-BR"], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :slim, :coffee]}

Any ideas?

Wes Foster
  • 8,770
  • 5
  • 42
  • 62

1 Answers1

1

You can use this form

render template: "carousels/items/new", locals: {caroulsel: caroulsel, type: "image"}
Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88