Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting ActionView::MissingTemplate at / error
    primarykey
    data
    text
    <p>I can't figure out why I'm getting an error on this rails tutorial. I've restarted everything (computer, web brick, sublime Text, etc). Any help is appreciated. </p> <p><strong>controllers/visitors_controller.rb</strong></p> <pre><code>class VisitorsController &lt; ApplicationController def new @owner = Owner.new render 'visitors/new' end end </code></pre> <p><strong>models/owner.rb</strong> </p> <pre><code> class Owner def name name = 'Foobar Kadigan' end def birthdate birthdate = Date.new(1990, 12, 22) end def countdown today = Date.today birthday = Date.new(today.year, birthdate.month, birthdate.day) if birthday &gt; today countdown = (birthday - today).to_i else countdown = (birthday.next_year - today).to_i end end end </code></pre> <p><strong>view/visitors/new.html.erb</strong></p> <pre><code> &lt;h3&gt;Home&lt;/h3&gt; &lt;p&gt;Welcome to the home of &lt;%= @owner.name %&gt;.&lt;/p&gt; &lt;p&gt;I was born on &lt;%= @owner.birthdate %&gt;.&lt;/p&gt; &lt;p&gt;Only &lt;%= @owner.countdown %&gt; days until my birthday!&lt;/p&gt; </code></pre> <p><strong>config/routes.rb</strong></p> <pre><code> LearnRails::Application.routes.draw do root to: 'visitors#new' end </code></pre> <p>Edit: Took out </p> <pre><code> render 'visitors/new' </code></pre> <p>and now getting this error:</p> <pre><code> ActionView::MissingTemplate at / Missing template visitors/new with {:locale=&gt;[:en], :formats=&gt;[:html], :handlers=&gt;[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "/Users/waymond/Rails_App/learn-rails/app/views" * "/Users/waymond/Rails_App/learn-rails" * "/" </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload