Heroku 部署练习

2017-03-27  本文已影响13人  TW妖妖

1.让生产环境中的应用显示“hola, mundo!”

#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception
  def hello
    render html: "hola, mundo!"
  end
end```
- (2) 设置根路由

config/routes.rb

Rails.application.routes.draw do
root 'application#hello'
end```

上一篇 下一篇

猜你喜欢

热点阅读