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 "http://127.0.0.1:3000/mytest/index" on my computer i have created a controller
named mytest that contain code like

class MytestController < ApplicationController
  def index
    render_text "Hello"
  end
end


can any one help me on this issue

Thanks

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
end
end

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