16 search resultsShowing 1~16 results

Stocked

拥抱 Rails 4_3

ActiveRecord Scopes 顺着上一节的话题,我们继续讲讲 Scopes。在 Rails 4 当中,eager-evaluated scopes 不再推荐使用了,因为通常没搞清对象(...

1
1
Comment0

拥抱 Rails 4_1

Routes 小心地使用 Match(Rails 3 已实现) Rails 3 提供了 match 方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attac...

1
1
Comment0

Alias Method

有时候我们需要两个不同名字的方法,但是其内部实现却是可能一样的。为了不重复我们的代码,我们可以用 alias_method 来复制方法以实现这一目的: Class Timeline def in...

0
0
Comment0

Struct.new

Ruby 的类定义有两种方式,多数情况下人们较为熟悉这一种: class Person attr_accessor :first_name, :last_name def initialize(...

0
0
Comment0

Git on the Server

远程代码库通常只是一个“纯仓库”(bare repository)——一个没有当前工作目录的仓库;仓库里仅仅是 Git 的数据,也就是 .git 目录里的内容。 协议 Git 可使用四种协议来传...

1
1
Comment0

16 search resultsShowing 1~16 results

Qiita is a knowledge sharing service for engineers.

  1. You can follow users and tags
  2. You can stock useful information
  3. You can make edit suggestions for articles
Functions that can be used after logging in