Forum: Ruby on Rails Missing Template

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2b0d58ce16a8b973f3687a0f99586580?d=identicon&s=25 Shelly (Guest)
on 2009-02-28 12:53
(Received via mailing list)
Hi,

I am trying to create a hello world application, where the controller
(Say) only has one action:

def hello
end

And the view, hello.rhtml, has <h1>HELLO WORLD</h1>.  When I run it,
it says Missing template say/hello.html.erb in view path C:/
InstantRails/rails_apps/bob/app/views.

I put hello.rhtml (also tried .html.erb, same error) in that spot, but
it still gives the missing template error.

I appreciate your help!
Shelly
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2009-02-28 15:37
(Received via mailing list)
So you have the view template
C:/InstantRails/rails_apps/bob/app/views/say/hello.html.erb

and the view template looks like

<h1>HELLO WORLD</h1>

and the controller

C:/InstantRails/rails_apps/bob/app/controllers/say_controller.rb

and the controller looks like

class SayController < ApplicationController
  def hello
  end
end

and you're still getting an error?


--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
2b0d58ce16a8b973f3687a0f99586580?d=identicon&s=25 Shelly (Guest)
on 2009-02-28 18:21
(Received via mailing list)
yes, that's what I have..
52b5bbb8f48796603ecc1ed58fe6e7f4?d=identicon&s=25 yaskyj (Guest)
on 2009-02-28 23:52
(Received via mailing list)
These are the steps I would take to set up that app.

In the terminal window:

$ rails bob

$ cd bob

/bob$ script/generate controller Say hello (this will set up the empty
hello method in the Say controller and hello.html.erb)

/bob$ script/server

Open the hello.html.erb template and change the contents to <h1>Hello,
World!</h1>

Open a browser and navigate to http://localhost:3000/say/hello

Hope this helps.
This topic is locked and can not be replied to.