Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
@vkill
高级会员
第 120 位会员 / 2011-11-17

7 篇帖子 / 294 条回帖
4 关注者
0 正在关注
114 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 测试无效的问题 at 2012年03月17日

    貌似是对的呢?

    new_post = post.clone
    new_post == post # true
    
    new_post = post.dup
    new_post.new_record? # true
    new_post.id # nil
    new_post.save! #true
    new_post == post # false
    
    
  • coffescript、haml、scss 是不是跟 rails 高度集成的?可否用在别的框架? at 2012年03月16日

    python 不是有 jinja2 吗?haml slim 这都是一个性质的,用 rials 吧,django 确实还有很多要改进的地方

  • RubyMine 能把整个项目的 UML 图给画出来吗? at 2012年03月16日

    这个不是有个 gem 吗? https://github.com/voormedia/rails-erd

  • Ruby 编程风格介绍 (补全篇) at 2012年03月15日

    为啥不推荐用 %q 呢?不明白,多行的时候 %q 多好,哈哈

    /?xx/ 看到这种写法想到 python,呵呵

  • view 中文不能显示 at 2012年03月15日

    application 里设置 utf-8 没?

  • [上海] 如果你是 Geek at 2012年03月14日

    哈哈,貌似是 CML,cmd 很容易让人想到 win

    Pro Git 非常的好

  • 有谁知道敏捷开发第 4 版中文翻译进展? at 2012年03月13日

    http://product.china-pub.com/199081

    第四版翻译出来了

  • ruby what is #$ ?? at 2012年03月13日

    在 irb 中不行啊?还是规矩的加上{}比较好

    puts "#$""
    
    
  • 如何让 RAILS 支持中文路径? at 2012年03月12日

    http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to

  • 安装 rails 出现了问题 at 2012年03月12日

    我一直用 arch,挺好的啊,没发现啥莫名其妙的问题

  • 求推荐支持 hierarchy model 的 gem at 2012年03月12日

    ancestry 挺好的啊

  • 发觉这里很多人用 Devise,谁能分享比较 Devise 和 Sorcery at 2012年03月12日

    socery 比 devise 要灵活点,不过我觉得与其用 socery,还不如直接上 omniauth

  • Devise 如何将更新密码和更新用户个人信息分开? at 2012年03月12日

    本身设计上就应该分开吧?修改密码需要原始密码的啊

  • railstutorial 比 Agile Web Development with Rails 好多了 at 2012年03月11日

    官方的 guides 挺好的,不过刚开始学习还是看下书,对 rails 有个大概的理解比较好

  • 求书《ruby 编程语言》 at 2012年03月11日

    淘宝卖的多,卖 40+ 的应该都是正版

  • 请问各位有没 cancan 中文详细一些的教程呢? at 2012年03月09日

    cancan 的官方 wiki 写的很详细了 关于你说的 roles_mask 这里 http://cn.asciicasts.com/episodes/189-embedded-association 说的很清楚

  • 尝试 Rails,问个比较随便的问题。 at 2012年03月09日

    #20 楼 @ery 问下,email gmail googleappmail 这三个东西不重复吗?

  • [上海][2012年03月13日] RubyTuesday 活动公告 at 2012年03月08日

    争取过去

  • [上海] 创业公司招 ruby 攻城狮 at 2012年03月08日

    职责?待遇?

  • 各位是因为什么事件和原因接触到 Ruby at 2012年03月06日

    07 年想学一门动态语言,比较了 python perl ruby,最后选择了 ruby

  • RVM 的 Mixed mode 在 Ubuntu/Debian 上怎么设置? at 2012年03月06日

    @foxzool +1 我也是 capistrano 里加 set :use_sudo, false set :user, "www" 来做的,这样都打包在了 /**/rails_apps/shared/bundle 下,比较方便,不会出现 bundle path 的问题 gemset 这东西基本上没用了

  • 一个小 Bug 引发 github 安全问题泄露。Shit! at 2012年03月06日

    #64 楼 @poshboytl 个人认为 1、mass assignment 必须信任 controller 2、dhh 的做法对于 3.1+ 是多此一举,mass assignment 是 3.1 加入的功能,3.1 以前确实按 dhh 那样干过 3、给 model 只需要传 user_id 就好,不需要 session 啊。

    另外对于 user_id 我的做法是,加个 set_current_user before_filter,这样 request 过来的 user_id 都会被覆盖。model 里不对 user_id 做权限方面的验证,只管保存就好,是不是 admin 都在 controller 里判断

    private
      def set_current_user(resource_name=nil, attribute_name="user_id")
        return unless current_user.respond_to?(:id)
        resource_name ||= controller_name.singularize
        params[resource_name] ||= {}
        params[resource_name][attribute_name] = current_user.id
      end
    
    
    
  • 有多少人读过《Ruby for Rails》 at 2012年03月05日

    #7 楼 @fsword http://product.dangdang.com/product.aspx?product_id=20693729 这本?

  • 一个小 Bug 引发 github 安全问题泄露。Shit! at 2012年03月05日

    @hisea 你说错了,哈哈,attr_accessible + mass_assignment 试试看?

  • 最完整的 Ruby 网络异常列表? at 2012年03月05日

    @iwinux 另外 404 500 是 response 错误哈,也可以看官方文档

    HTTPResponse
        HTTPUnknownResponse
        HTTPInformation                    # 1xx
            HTTPContinue                       # 100
            HTTPSwitchProtocol                 # 101
        HTTPSuccess                        # 2xx
            HTTPOK                             # 200
            HTTPCreated                        # 201
            HTTPAccepted                       # 202
            HTTPNonAuthoritativeInformation    # 203
            HTTPNoContent                      # 204
            HTTPResetContent                   # 205
            HTTPPartialContent                 # 206
        HTTPRedirection                    # 3xx
            HTTPMultipleChoice                 # 300
            HTTPMovedPermanently               # 301
            HTTPFound                          # 302
            HTTPSeeOther                       # 303
            HTTPNotModified                    # 304
            HTTPUseProxy                       # 305
            HTTPTemporaryRedirect              # 307
        HTTPClientError                    # 4xx
            HTTPBadRequest                     # 400
            HTTPUnauthorized                   # 401
            HTTPPaymentRequired                # 402
            HTTPForbidden                      # 403
            HTTPNotFound                       # 404
            HTTPMethodNotAllowed               # 405
            HTTPNotAcceptable                  # 406
            HTTPProxyAuthenticationRequired    # 407
            HTTPRequestTimeOut                 # 408
            HTTPConflict                       # 409
            HTTPGone                           # 410
            HTTPLengthRequired                 # 411
            HTTPPreconditionFailed             # 412
            HTTPRequestEntityTooLarge          # 413
            HTTPRequestURITooLong              # 414
            HTTPUnsupportedMediaType           # 415
            HTTPRequestedRangeNotSatisfiable   # 416
            HTTPExpectationFailed              # 417
        HTTPServerError                    # 5xx
            HTTPInternalServerError            # 500
            HTTPNotImplemented                 # 501
            HTTPBadGateway                     # 502
            HTTPServiceUnavailable             # 503
            HTTPGatewayTimeOut                 # 504
            HTTPVersionNotSupported            # 505
    
  • 最完整的 Ruby 网络异常列表? at 2012年03月05日

    @iwinux 这个得看你用的哪个 gem 吧?gem 中是否很详细的定义这些 error

    比如 net/http net/http.rb 里 require 了 net/protocol 和 openssl 那么就可以在这两个文件里查找定义的 error 类了 如

    #http.rb 里的
    class HTTPBadResponse < StandardError; end
    class HTTPHeaderSyntaxError < StandardError; end
    
    #protocol.rb 里的
    class ProtocolError          < StandardError; end
    class ProtoSyntaxError       < ProtocolError; end
    class ProtoFatalError        < ProtocolError; end
    class ProtoUnknownError      < ProtocolError; end
    class ProtoServerError       < ProtocolError; end
    class ProtoAuthError         < ProtocolError; end
    class ProtoCommandError      < ProtocolError; end
    class ProtoRetriableError    < ProtocolError; end
    ProtocRetryError = ProtoRetriableError
    

    当然还有 openssl 的,自己查下了

  • 一个小 Bug 引发 github 安全问题泄露。Shit! at 2012年03月05日

    dhh 说的这种方法在 3.1 之前基本就这么搞,不过 3.1 后我更喜欢 mass assignment

  • 有多少人读过《Ruby for Rails》 at 2012年03月05日

    这本太老了吧?从目录来看 ruby 和 rails 都没讲清楚,ruby 看了 搞头书 和 元编程 就够了

  • 上一页
  • 1
  • 2
  • …
  • 6
  • 7
  • 8
  • 9
  • 10
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English