Create Messages 1 - error message - missing template


#1

Hi,

I am feeling really frustrated at the errors I keep encountering on the Ruby on Rails course. Currently, on exercise 5 I try to add the new action to the Messages controller

def new @message = Message.new end

However when I try to run this I get the following error message-

` Missing template messages/new, application/new with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in:

and am unable to proceed.
Anyone know what this is about?
Many thanks


#2

Hi @codebabee,

Can you can see the file app/views/messages/new.html.erb in the file browser in the code editor?


#3

I’m having the exact same problem. I checked if there was said file in this directory and it is not there. What should I do next?


#4

Im also having this same problem.


#5

When you hover app/views/messages click on the three dots on the right side.
Choose New File and name it new.html.erb

Click run again and there you go :slight_smile:

Just found out that when you’re in Associations I => 5. Show a tag, you will encounter the same ‘missing template error’.
Here you can use the same solutions as above(only need to replace new for show).


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.