look_controller.rb

来自「ajax在ruby中的应用」· RB 代码 · 共 13 行

RB
13
字号
class LookController < ApplicationController
  def at
  end

  WORDS = ["This", "is", "a", "test", "here", "are", "the", "words"]

  def getter
    @term = request.raw_post
    regexp = Regexp.new(@term)
    @found = WORDS.find_all{ |term| term =~ regexp }
  end
end

⌨️ 快捷键说明

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