decorator
嗯,目测 lz 的主浏览器一定不是 firefox 这问题自己本地 staging 环境上测试 nginx 用 static.domain.com 传静态文件就发现了……然后顺手给 ttf|eot|sfd 自己加上 gzip 了……
啊,啊,用 MAC 就一定不会出现 gem 包 mysql2 安装报错 之类的问题了,对吧?
self.id 本来就不是 string 类型……这两个查询只是看起来是一样的而已……
#11 楼 @blacktulip 至少做码农,没人会拿刀砍你……
#8 楼 @blacktulip 医生这工作其实也是吃力不讨好的……
#5 楼 @blacktulip 明显是医学门槛高……
主要是门槛太高……
#22 楼 @lidashuang 你是说,如果用 angularjs 还用 jquery? 难道你不知道 angularjs 入门第一件事情就是Don't even use jQuery么……
#20 楼 @lidashuang 你用 backbone 把它完整做出来而完全不用 jquery 时再说
#16 楼 @lidashuang 呵呵,我说的光是 自己要写的代码 多么?自己实际去看一下总体成品体积很难么?
   169 angularjs/js/directives/todoFocus.js.minified
   127 angularjs/js/directives/todoBlur.js.minified
   212 angularjs/js/services/todoStorage.js.minified
    54 angularjs/js/app.js.minified
   913 angularjs/js/controllers/todoCtrl.js.minified
  2920 angularjs/bower_components/todomvc-common/base.js.minified
 88802 angularjs/bower_components/angular/angular.js.minified
 13379 angularjs/bower_components/angular-mocks/angular-mocks.js.minified
   206 angularjs/test/config/testacular.conf.js.minified
   726 angularjs/test/unit/directivesSpec.js.minified
  2850 angularjs/test/unit/todoCtrlSpec.js.minified
110358 总用量
  1805 backbone/js/views/app.js.minified
  1201 backbone/js/views/todos.js.minified
   215 backbone/js/routers/router.js.minified
   167 backbone/js/models/todo.js.minified
    66 backbone/js/app.js.minified
   438 backbone/js/collections/todos.js.minified
  2920 backbone/bower_components/todomvc-common/base.js.minified
 94839 backbone/bower_components/jquery/jquery.js.minified
  2483 backbone/bower_components/backbone.localStorage/backbone.localStorage.js.minified
 19563 backbone/bower_components/backbone/backbone.js.minified
 14219 backbone/bower_components/underscore/underscore.js.minified
137916 总用量
压缩后,这 backbone 实现比 angularjs 实现算上测试代码还大差不多 1/4,这尼玛叫轻量级?要是光算自己需要写的代码数,更是甩好几条街了,backbone 本身太小,然后你自己要干的事情反而多了
#8 楼 @lidashuang 你去 clone 一份 todomvc 然后
cd architecture-examples
for i in *;do find $i | grep 'js$' | grep -v components | grep -v lib | xargs  wc -l;done > result.txt
看看实现同样功能所需的代码量就知道了,这还是简单的功能,要是想做点复杂的,算上各种库的体积,呵呵
backbone 太重了……
#63 楼 @quakewang 
大概是没考虑到 F5 刷新吧……F5 强迫症的人应该挺多的……
 在 ruby-china 按 F5 图片会返回 304
在 ruby-china 按 F5 图片会返回 304
 不过貌似响应速度有点慢
另外为啥 Server 是 Microsoft-IIS/6.0……
不过貌似响应速度有点慢
另外为啥 Server 是 Microsoft-IIS/6.0……
弱弱地问一下,你们这么多图片为啥都不让浏览器缓存呢,第二次访问返回 304 什么的……
#16 楼 @blacktulip 看起来好麻烦的样子,貌似还没有自己绑个快捷键 :s 来得方便……
看了一下,这魔杖怎么可能是 ruby,明明是 QB……
无聊是件很危险的事情……

#39 楼 @hardywu 哦原来有这个问题啊,不过大概因为我用的是"非标准"做法,反而都绕过去了…… working example:
class AttachmentsController < ApplicationController
  before_action :authenticate_user!
  before_action :create_attachment, only: :create
  load_and_authorize_resource
  respond_to :html, :json
  def index
    @attachments = current_user.photos.recent_upload.limit(10)
  end
  def create
    @attachment.save
    respond_with @attachment
  end
  def destroy
    @attachment.destroy
    respond_with @attachment
  end
  private
  def attachment_params
    params.require(:attachment).permit(:file)
  end
  def create_attachment
    if current_user
      @attachment = current_user.photos.build(attachment_params)
    end
  end
end