Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@blueplanet
VIP
NO. 2650 / 2012-06-25

20 Topics / 226 Replies
3 Followers
2 Following
16 Favorites
GitHub Public Repos
  • hotwire-scaffold 2

  • bitcoin-ruby 1

  • blueplanet.github.com 1

  • re-work 0

  • twa-template 0

    Boilerplate starter template for a new Telegram Web App (TWA) interacting with the TON blockchain

  • bundler 0

  • account-abstraction 0

  • blueplanet 0

  • gatsby-starter-default 0

  • solidity 0

    Solidity, the Smart Contract Programming Language

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 请问,每次 rails generate 都要--skip-test-unit 或者 --skip-stylesheets,能不能有什么配置,不需要每次都要输入这么长 at November 12, 2012

    --skip-test-unit

    如果在生成项目的时候使用-T选项的话,以后就不会生成 TEST UNIT 的东西了。

    --skip-stylesheets 可以这样设置

    module YourApp
      class Application < Rails::Application
        #...
        config.generators do |g|
          g.assets     false
          g.helper     false
        end
        #...
      end
    end
    
  • 为什么用 Cucumber, 及根据抽象的层面选择工具 at November 12, 2012

    #3 楼 @knwang 原本打算放弃学习 cucumber 了。现在看来还是很有必要的啊。

    合适的工具本身会帮助你集中思考某层面需要的东西,有利于发散性的创造过程。

    这句话对我很有意义。谢谢!

  • 沉重的产品 at November 06, 2012

    #15 楼 @huacnlee +1

  • 号召贴:组队报名 railstutors 课程 at October 24, 2012

    #26 楼 @knwang 噢!这句确实有意思!

  • 号召贴:组队报名 railstutors 课程 at October 24, 2012

    #24 楼 @knwang 话说你的头像这是啥时候和 Matz 照的啊?最近有啥活动了?

  • Agile Web Development with Rails 第四版第九章疑惑 at October 24, 2012

    我理解是这样的: 本质上和LineItem.new是一样的,目的就是创建一个新的@line_item。 使用@cart.line_items.build(:product => product)的好处是会自动把新生成的@line_item和@cart关联起来。

    总的来说和下面的代码是一样的效果

    def create
      @cart = current_cart
      product = Product.find(params[:product_id])
      @line_item = LineItem.new(:product => product)
      @cart.line_items << @line_item
      #......
    end
    
  • Happycasts: 用 tmux 畅游命令行 at October 23, 2012

    话说 tmux 里如何高亮或者突出显示当前的 panel 啊?不会经常找不到光标么?尤其是观看者

  • Sublime Text 2 怎样直接运行代码? at October 19, 2012

    想要在 SublimeText2里执行Shell命令的话,貌似需要从命令行启动,而不是直接启动SublimeText2。我遇到过这样的情况

  • [北京][2012年10月21日] Ruby 活动 有机械键盘、鼠标垫、卫衣等礼品 at October 19, 2012

    不在北京,没办法直接参加的人,有视频直播看么?

  • 在 heroku 上部署 rails 时出错,谁有经验分享一下。。 at October 18, 2012

    不应该把gemfile.lock删掉,而是应该把它加到git里,并push到 Heroku 上去

  • 现场演示的回馈 at October 17, 2012

    #21 楼 @knwang 原来如此。

    看到有介绍spork-rails这个 gem 的,就是一次加载,然后每次执行测试的时候就不需要重新加载rails环境了。尝试了一下,貌似速度确实很快啊。

    看有些环境是 guard + spork 来监视文件变动,自动执行测试的。 是不是这样做有什么不好的地方?

  • 现场演示的回馈 at October 17, 2012

    #18 楼 @knwang “尽量不加 spec_helper”是什么意思啊。是因为 spec_helper 里加载的东西太多影响速度么?

  • 就教:怎么知道一个 method 继承自哪里 class 或 module? at October 16, 2012

    如果用 pry 的话,使用show-method可以找到,而且直接把源代码显示出来

    [3] pry(User):1> show-method database_authenticatable 
    
    From: /Users/joker/pasokara_player_rails3/vendor/bundle/ruby/1.9.1/gems/devise-2.0.0/lib/devise/schema.rb @ line 16:
    Number of lines: 8
    Owner: Devise::Schema
    Visibility: public
    
    def database_authenticatable(options={})
      null    = options[:null] || false
      default = options.key?(:default) ? options[:default] : ("" if null == false)
      include_email = !respond_to?(:authentication_keys) || self.authentication_keys.include?(:email)
    
      apply_devise_schema :email,              String, :null => null, :default => default if include_email
      apply_devise_schema :encrypted_password, String, :null => null, :default => default, :limit => 128
    end
    
  • 在 heroku 上部署 rails 时出错,谁有经验分享一下。。 at October 12, 2012

    #5 楼 @menghuanwd #3 楼 @xiaolai

    gem 'sqlite3', :group => [:development, :test]
    
    group :production do
      gem 'thin'
      gem 'pg'
    end
    

    看他这段代码的话,已经写了pg了。 貌似应该是别的错误

  • 在 heroku 上部署 rails 时出错,谁有经验分享一下。。 at October 12, 2012

    第二次错误是什么

  • Mountain Lion 中使用 Guard 这样的服务还是要用 Growl 么? at October 09, 2012

    Guard 的 Github 首页说明里有 https://github.com/guard/guard#terminal-notifier

  • 番茄土豆:小小生产力工具 at September 19, 2012

    收藏!非常简洁的设计,很喜欢。 正打算自己做一个,就用你的了!

  • 开发模式启动 rails server 后,貌似 CSS 没起作用 at September 19, 2012

    搞定了!看到了漂亮的红宝石!

  • 开发模式启动 rails server 后,貌似 CSS 没起作用 at September 19, 2012

    不好意思,找到原因了。

    需要执行一下bundle exec rake assets:precompile来生成需要的资源文件。

  • 类方法可以这么用? at September 15, 2012

    #7 楼 @dfang 原来如此。我只是单独写了个类跑了一下,场景完全不对啊。应该继承ActiveRecord跑一下的。

  • 类方法可以这么用? at September 09, 2012

    看了一下,貌似确实有问题啊

    @project.tasks应该是 task 的数组吧,应该是不能用find_incomplete方法的

  • Rails 下有什么比较好的博客框架嘛? at August 08, 2012

    jekyll + github.pages

  • 大家看下这段`ActiveRecord 下 find 方法实现' 的伪码是不是有问题? at August 03, 2012
    • 首先,这个源代码应该和 Rails 的代码无关吧。应该是特定的应用里面的代码,所以对belongs_to的定义应该不会有影响。只是对books有影响吧
    • 其次,同意 @ericguo 的说法。这个方法的意思应该是重新定义 Books 的 Find 方法。目的应该是从 Books 表里查找记录,同时去各个关联表里找到相关的信息。如果相关表里没有信息,那对应的字段就为空。
  • Sublime Text 2 插件分享:语法识别插件 DetectSyntax at July 19, 2012

    这个非常实用。目前是通过自己写插件实现的。

  • 用自己域名的邮箱不能注册? at June 26, 2012

    估计是@前面太短了吧

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