Search code examples
ruby-on-railsviewpartial

Rails can't find my partial. Missing partial error


I generated a new model called Comment.

rails g model Comment user_id:integer content:text
rake db:migrate

Then I create a simple partial view, that I intend to call from another controller/view.

enter image description here

Inside of a Product show view:

.comments
  h3
    | Questions and Answers:
    small for #{@product.name}

    = render 'comments/new'

Missing partial comments/new with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :slim, :coffee]}. Searched in: * "/Users/sergiotapia/Documents/Work/foobar/app/views"

I stopped and started the Rails application and it's still refusing to detect the partial. Am I overlooking something?

I would prefer not to move the comment form to the Products folder.


Solution

  • Incorrect File Extension

    Rename partial file to _new.html.slim. Currently html is misspelt as hmtl.