class MyTestController < ApplicationController def index render_text "hello world" end end
Это то, что я получаю, когда иду к http://127.0.0.1:3000/My_Test/:
NoMethodError в My testController # index неопределенный метод render_text для # RAILS_ROOT: C: / rails / rails_apps / cookbook Трассировка приложения | Framework Trace | Полная трассировка app / controllers / my_test_controller.rb: 5: в `index ' Запрос Параметры: Ни один Показать дамп сеанса Заголовки ответа: {"cookie" => [], "Cache-Control" => "no-cache"}
NoMethodError в My testController # index
неопределенный метод render_text для # RAILS_ROOT: C: / rails / rails_apps / cookbook
Трассировка приложения | Framework Trace | Полная трассировка app / controllers / my_test_controller.rb: 5: в `index ' Запрос
Параметры: Ни один
Показать дамп сеанса
Заголовки ответа:
{"cookie" => [], "Cache-Control" => "no-cache"}
пожалуйста, имейте в виду, что я следую этому уроку:
http://oreilly.com/pub/a/ruby/archive/rails.html?page=2
Этот урок очень старый и устарел. Метод render_text больше не существует. Вместо этого попробуйте следующее:
render_text
def index render :text => "hello world" end