⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 00 - introduction

📁 O Reilly Ruby Cookbook source code
💻
字号:
$ rails status      create      create  app/controllers      create  app/helpers      create  app/models      create  app/views/layouts      create  config/environments...#---$ cd status$ ./script/generate controller status index      exists  app/controllers/      exists  app/helpers/      create  app/views/status      exists  test/functional/      create  app/controllers/status_controller.rb      create  test/functional/status_controller_test.rb      create  app/helpers/status_helper.rb      create  app/views/status/index.rhtml#---class StatusController < ApplicationController  def index    # This variable won't be accessible to the view, since it is local    # to this method    time = Time.now    # These variables will be accessible in the view, since they are    # instance variables of the StatusController.    @time = time    @ps = `ps aux`  endend#---<h1>Processes running at <%= @time %></h1><pre><%= @ps %></pre>#---$ ./script/server=> Booting WEBrick...=> Rails application started on http://0.0.0.0:3000=> Ctrl-C to shutdown server; call with --help for options...#---$ ./script/generate controller hello world#---class HelloController < ApplicationController  def world  endend#---<p>Several increasingly silly ways of displaying "Hello world!":</p><p><%= "Hello world!" %></p><p><%= "Hello" + "world!" %></p><p><%= w = "world"       "Hello #{w}!" %></p><p><%= 'H' + ?e.chr + ('l' * 2) %><%=('o word!').gsub('d', 'ld')%></p>#---<% hello = "Hello" %><% world = "world!" %><%= hello %> <%= world %>#---

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -