Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
刘昊
@leomayleomay
VIP
NO. 1225 / 2012-02-28

5 Topics / 158 Replies
2 Followers
0 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 一个重构代码的问题 at May 17, 2013

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

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

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

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

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

  • 笑死我了,汗颜 at April 28, 2013

    老湿

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

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

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

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

  • [帮朋友发帖] 招聘 ruby 工程师 at April 24, 2013

    郭晶晶,好吧,夹紧!

  • 狗狗丢了,好难过!!! at April 17, 2013

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

  • form_for 的 collection_select 这种结构有没有 API 可以直接生成。 at April 17, 2013

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

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

    auto_increment

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

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

  • 请教多个模型复用 Category 的办法 at March 10, 2013

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

  • 请教多个模型复用 Category 的办法 at March 10, 2013

    思路: 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 February 14, 2013

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

  • polymorphic 与 accepts_nested_attributes_for 与 file upload at February 12, 2013

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

  • polymorphic 与 accepts_nested_attributes_for 与 file upload at February 10, 2013

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

  • 参数如果带.怎么办 at November 30, 2012

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

  • 信用卡支付 at November 15, 2012

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

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

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

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

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

  • 关于用 resque 发邮件 at November 08, 2012

    传 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 November 08, 2012

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

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

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

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

    (5.0/4).ceil

  • 请问 Rspec 里的 assigns [] 是做什么的呢? at October 24, 2012

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

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

    ckeditor

  • 请问大家是怎么看 rails 代码的 at July 26, 2012

    前面加个断点,跟进去

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

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

  • 问个 RSpec 的问题 at July 16, 2012

    没有 assert

    assert false

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