按照惯例,还是打印出Hello world.
/app/controllers/stories_controllers.rb:
class StoriesController<ActionControllers::Base
def index
@varies="hello world"
end
end
/views/stories/index.html.erb:
<%=@varies%>
/config/routes.rb
ActionController::Routing::Routes.draw do |map|
map 'stories',:controller=>'stories',:action=>'index'
end
启动服务在IE中打开:
http://localhost:3000/stories
OK