Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
刘昊
@leomayleomay
高级会员
第 1225 位会员 / 2012-02-28

5 篇帖子 / 158 条回帖
2 关注者
0 正在关注
0 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 一个重构代码的问题 at 2013年05月17日

    @robot_zhang 用attr_accessor :name, 会有成员变量@name

    class Product
      # overwrite the product#name method
      def name
        @name.foobarbaz
      end
    end
    
  • 一个重构代码的问题 at 2013年05月17日
    class Product
      # overwrite the product#name method
      def name
      end
    end
    
  • 这么好的重构文章不转怎么行? 记 tower.im 的一次重构 at 2013年05月03日

    个人认为”comment“这个 action 应该挪到”comments_controller#create“里面,尽量不要发明自己的 action,尽量使用符合 REST 标准的 actions

  • 有句格言道:“不要通过共享内存来通信,要通过通信来共享内存。” at 2013年05月03日

    貌似楼主说的不是 Erlang 中的消息机制,而是 objects 之间的 message,通过 message 的传递减少对象之间的耦合,个人意见,欢迎指正

  • 笑死我了,汗颜 at 2013年04月28日

    老湿

  • [济南][2013年5月5日] Ruby Sunday 活动召集 at 2013年04月27日

    @2forVendetta @lgn21st 我就不过去了,这边项目太忙,不好意思了

  • [济南][2013年5月5日] Ruby Sunday 活动召集 at 2013年04月27日

    好吧,冒个泡,我也是青岛的,@dexter也是青岛的,青岛做 Rails 的其实不少,只是没有企业在用,都是自由职业,正因为是荒漠,才意味着机遇

  • [帮朋友发帖] 招聘 ruby 工程师 at 2013年04月24日

    郭晶晶,好吧,夹紧!

  • 狗狗丢了,好难过!!! at 2013年04月17日

    安慰一下,我也知道那种感觉

  • form_for 的 collection_select 这种结构有没有 API 可以直接生成。 at 2013年04月17日

    http://harvesthq.github.io/chosen/

  • 如何生成一个连续的数字作为 Model 的一列? at 2013年04月04日

    auto_increment

  • [上海] 改变中国足球的气场!等你加入! Ruby、App 程序员招聘贴 at 2013年04月04日

    "如果运动员带球穿档过人并且在球碰到场地之前控制住球,则直接获胜" -- KT 规则 作为一个踢了将近 20 年球的资深球盲,我表示压力很大,您说的"场地"是指四周的围栏?如果是地面,这规则设计是坑爹呢!!

  • 请教多个模型复用 Category 的办法 at 2013年03月10日

    @wuwx, movie has_many :categories, :through => :categorizations

  • 请教多个模型复用 Category 的办法 at 2013年03月10日

    思路: 1, Categorizable (Music, Movie) 与 Category 是多对多关系, 2, Category knows nothing about Categorizable, the connections between "Categorizable" and "Category" are made by a table named "Categorization"

  • [青岛][2013-02-15] 两个 Daniel 组织的青岛 Ruby 与敏捷社区聚会 at 2013年02月14日

    不在家啊,到时候,两个 daniel 二人转?

  • polymorphic 与 accepts_nested_attributes_for 与 file upload at 2013年02月12日

    把homework#create的 params 贴上来看看,感觉你的参数有问题

  • polymorphic 与 accepts_nested_attributes_for 与 file upload at 2013年02月10日

    <%= f.fields_for :attachments do |ff| %> 改成 <%= f.fields_for :attachments, @homework.attachments.new do |ff| %>试试呢?

  • 参数如果带.怎么办 at 2012年11月30日

    http://stackoverflow.com/questions/2952235/rails-params-with-dot-e-g-google-com

  • 信用卡支付 at 2012年11月15日

    stripe 很好,但是需要美国的 SSN,如果能搞定这个,stripe 还是不错的。另外,收费也是楼主需要考量的依据。

  • 图片上传以及预览功能求助,求给几个链接,3Q! at 2012年11月10日

    http://stackoverflow.com/questions/4459379/preview-an-image-before-it-is-uploaded

  • Upload 文件的速度很慢,是什么原因呢? at 2012年11月09日

    @Roam 这些 hooks 都是在 server side 执行的,如何让你的 client 知道执行的结果?推荐阅读 juggernaut 或者 websocket 相关资料

  • 关于用 resque 发邮件 at 2012年11月08日

    传 id,不要传对象

    Oh, by the way. Don't forget that your async mailer jobs will be processed by a separate worker. This means that you should resist the temptation to pass database-backed objects as parameters in your mailer and instead pass record identifiers. Then, in your delivery method, you can look up the record from the id and use it as needed.

  • Upload 文件的速度很慢,是什么原因呢? at 2012年11月08日

    首先,你要分开上传和数据处理这两个任务,你的 controller 在文件上传之后,将 csv 保存下来之后,就可以返回 response 给客户端了,数据处理应当放到另外一个 process(后台)中去运行,否则有可能导致 timeout, 可以借助的 gem 有 delayed_job 或者 resque

  • 在 mac os x 10.8 xcode 4.5 的环境下安装 ruby 时报 gcc 的错误应该解决呀? at 2012年10月28日

    https://github.com/kennethreitz/osx-gcc-installer

  • 求运算式的一个上界,例如 5%4 我取值 2 怎么操作? at 2012年10月25日

    (5.0/4).ceil

  • 请问 Rspec 里的 assigns [] 是做什么的呢? at 2012年10月24日

    controller 里面 instance variable, 类似 PostsController 里面的@posts或者@post

  • ror 是 2.0.2,请推荐一个富文本编辑器 at 2012年10月10日

    ckeditor

  • 请问大家是怎么看 rails 代码的 at 2012年07月26日

    前面加个断点,跟进去

  • 如何同时使用 sqlite 和 mysql,或者其他数据库 at 2012年07月21日

    导成中间格式,比如 yaml 或者 csv,如果是 yaml 的话,可以搜下 yaml_db 这个 gem

  • 问个 RSpec 的问题 at 2012年07月16日

    没有 assert

    assert false

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