Create a simple application with ROR

>rails demo 

>cd demo

>ruby script/server       

 

http://localhost:3000

 

further more,create  a controller

demo> ruby script/generate controller Say

You’ll find it in the file    app/controllers/say_controller.rb
 
class SayController < ApplicationController
end

 

then,create an action and name it hello

class SayController < ApplicationController
  def hello
  end
end

 we also need  to create a file called
app/views/say/hello.rhtml

 <html>
<head>
<title>Hello, Rails!</title>
</head>
<body>
<h1>Hello from Rails!</h1>
</body>
</html>

 

now  you can visit your site:

http://localhost:3000/say/hello



你可能感兴趣的:(html,Ruby,Rails)