views:

18

answers:

1
class MyTestController < ApplicationController
    def index
        render_text "hello world"
    end
end

This is what I am getting when I go to http://127.0.0.1:3000/My_Test/ :

NoMethodError in My testController#index

undefined method `render_text' for # RAILS_ROOT: C:/rails/rails_apps/cookbook

Application Trace | Framework Trace | Full Trace app/controllers/my_test_controller.rb:5:in `index' Request

Parameters: None

Show session dump

Response Headers:

{"cookie"=>[], "Cache-Control"=>"no-cache"}

please keep in mind i am following this tutorial:

http://oreilly.com/pub/a/ruby/archive/rails.html?page=2

+3  A: 

That tutorial is very old and out of date. The render_text method no longer exists. Try the following instead:

def index
  render :text => "hello world"
end
Phil Ross
thank you phil!! can you reecomend some up to date tutorials?
I__
@every_answer You might like to take a look at the Getting Started with Rails guide at http://guides.rubyonrails.org/getting_started.html
Phil Ross