ruby只能做服务端也就是后端开发,前端依然需要使用javascript+css
不过javascript也可以用作后端开发,那就是nodejs
puts "hello 是写在rb文件中的eg
app/controllers/hello_controller.rb #画面的控制
class HelloController <ActionController
def index
@hello = "hello"
puts @hello # "hello"
end
end
app/views/hello/index.rhtml
<table border="1">
<tr>
<td><%=@hello%></td> #@hello 或者$hello 这种变量才能在页面中使用
</tr>
</table>
地址是:http://localhost:3000/hello/say