Topic: http://localhost:3000/mytest/index on webrick server

HI I am  using  ruby on rail on windows and i am  getting "http://localhost:3000/mytest/index"

Error When i run "" on my computer i have created a controller
named mytest that contain code like

class MytestController < ApplicationController
  def index
    render_text "Hello"

can any one help me on this issue


Vijay Patidar

Re: http://localhost:3000/mytest/index on webrick server

You are missing an element in your index action.

It should be something like:

def index
respond_to do |t|
t.html # index.html.erb

Then create index.html.erb in your mytest view, and put the line
<%= "Hello World!" %>

An action must point to an actual file in a view. Index does not exist without index.rhtml or index.html.erb.

Hope this helps. smile