Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Rei
@Rei
Admin
NO. 1 / 2011-10-28

[email protected]
深圳
182 Topics / 9132 Replies
727 Followers
0 Following
11 Favorites
中下水平 Rails 程序员
Reward
GitHub Public Repos
  • writings 940

    [Closed] Source code of writings.io

  • alipay 732

    Unofficial alipay ruby gem

  • code_campo 291

    [Closed] Source code of http://codecampo.com

  • asciidoctor-pdf-cjk-ka... 101

    **no longer maintained**

  • asciidoctor-htmlbook 31

    Asciidoctor HTMLBook is an Asciidoctor backend for converting AsciiDoc documents to HTMLBook docu...

  • material-ui 17

  • rich-text-editor 12

  • htmlrenderer 12

  • rails-chatgpt-demo 8

  • rails-app 7

    A Rails project template lets me start new projects quickly.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 这个应该放在 rails 版块里 at November 01, 2013

    是约定,可以改。

    • 路由要改,指定路径对应哪个 Controller
    • Model 要改,指定用哪个表
    • Model object 的自动 url helper 失效
    • 写文档告诉后来的维护者为什么要这么改
  • rails 的脚手架真的显得很初级吗? at November 01, 2013

    大版本更新我都会看看 scaffold 生成的内容啊,这是官方推荐的结构。实际中脚手架满足不了需求,要改页面,去掉一些 action,所以还是自己写好。

  • 关于 Writings.io at November 01, 2013

    writings.io 的后台数据其实并不好看,虽然很多人说喜欢,实际活跃用户很少。RubyConf 这两天也有很多人劝我将它继续下去,我还是觉得价值不大。并且博客项目跟社区不同,用户提交的内容更多是作为私有物,要求稳定,在我自己已经不打算用的情况下继续开着,让新用户注册并且投入心思在上面是不负责的。所以我没有改变关闭的决心。

  • 一个自由期刊平台: scixiv.com at November 01, 2013

    描述一下:

    1. 目标用户是谁
    2. 同类产品有什么
    3. 团队有几个人
    4. 如何运营和推广
    5. 版权如何处理

    其实我也不知道这个靠不靠谱,上面几条是普遍要考虑的问题。

  • 程序员装逼指南 at October 31, 2013

    #47 楼 @luikore 啊,安室奈美惠

  • rails 校验提示问题 at October 31, 2013

    楼主我帮你格式化代码了,编辑看看我加了什么。

  • rails 执行 修改 时 异常 :undefined method `name' for nil:NilClass at October 31, 2013

    楼主不是新人了,请把代码格式化好。

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at October 31, 2013

    #5 楼 @dume2007 目前看不出有没有关系,毕竟去掉了一个 gem,而且也不知道原来这个 gem 是做什么用的。

    看错误提示,第 18 行,undefined method query for nil:NillClass,这一行哪里调用了 query 呢?就是 @search 这个实例变量,而这个实例变量是怎么来的,要你看看代码。

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at October 31, 2013

    我看漏了

    ERROR: Repository not found.
    

    这句才是重点

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at October 31, 2013

    #2 楼 @dume2007 没有这个 repo https://github.com/turbosquid/config_pal,是不是已经被删了。

  • Partial Template 的问题 at October 31, 2013

    局部模板里面会有一个文件名同名的局部变量,对应这个模板就是 cart。

    这个变量可以显式传进去,也可以隐式传进去

    <!-- 显式 -->
    <%= render :partial => 'cart', :object => @cart %>
    <!-- :object 的值转成局部变量 cart -->
    
    <!-- 隐式 -->
    <%= render @cart %>
    <%= render :cart %> <!-- 这个好像会自动找 @cart,没有会报错,没测试过 -->
    

    在局部模板调用实例变量也行的,转成局部变量会比较解藕吧。

    局部模板还有一种用法,是直接传一个集合

    <%= render :partial => 'cart', :collection => @carts %>
    
    <!-- 等同于,但效率有差别,上面的效率高 -->
    <% @carts.each do |cart| %>
      <%= render cart %>
    <% end %>
    

    这时候外部并没有 @cart 这个实例,而是将 @carts 每个元素传进去,所以局部模板内部用 cart 局部变量就很自然了。

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at October 31, 2013

    问题原因是 github 的 ip 没有在本机的 ssh 可信任列表里面,通常第一次 ssh 链接的时候会询问是否信任这个 ip。

    楼主执行

    git clone "[email protected]:turbosquid/config_pal.git"
    

    有什么情况?

  • 关于代码量和测试覆盖率的问题 at October 31, 2013

    #23 楼 @jarorwar

    # valid user attributes
    def user_attributes
      { :email => '[email protected]', :telphone => '18900000001' }
    end
    
    test 'user attributes is valid' do
      user = User.new user_attributes
      assert user.valid?
    end
    
    test 'user email not valid' do 
        user = User.new( user_attributes.merge( :email => 'abce' ) )
        assert user.invalid?
    end
    

    这是不借助其他 gems 做的,实际上还会遇到 email 是否唯一的问题,更方便的是借助 FactoryGirl 来定义 valid 的测试对象。

  • 还是部署问题,在 ucloud 上 ubuntu 按 wiki 一步步操作,问题好多。。。 at October 31, 2013

    根本没那么麻烦。四条命令,在纯净的 ubuntu 12.04 测试通过。

    sudo apt-get install curl
    curl -L https://get.rvm.io | bash -s stable
    source ~/.bash_profile
    rvm install 2.0.0
    

    这时候 ruby 已经切换到 2.0.0-p247 了。

    外一则:如果是在本地的 Ubuntu 下,修改终端的设置,勾选这项

    ssh 连接远程服务不需要这条,因为已经是 login shell 了。

  • KindEditor,rails 中如何显示摘要? at October 30, 2013

    strip_tags

  • 关于代码量和测试覆盖率的问题 at October 30, 2013

    #21 楼 @yfractal 留给用户测~

  • 关于代码量和测试覆盖率的问题 at October 30, 2013

    #17 楼 @fredwu 1929 / 2045 LOC (94.33%) covered

    我第一次测覆盖度,原来 0.4 已经覆盖这么广,我满足了……

  • 关于代码量和测试覆盖率的问题 at October 30, 2013

    我最近的 writings.io 是 0.4

  • 请教一个 Web 开发异步任务的问题,用的 rails at October 29, 2013

    我会用任务队列,sidekiq 比 resque 省内存。

  • Ruby China 已经正式换成 Puma 来跑了! at October 29, 2013

    以后我也试试。

  • mina 部署 rails 时出错 at October 29, 2013

    我看你的 git repo

    set :rails_env, 'staging'
    

    这样会去读 database.yml 的 staging 配置,把这行去掉,默认用 production。

  • mina 部署 rails 时出错 at October 29, 2013

    要看 databaes.yml 内容,文件是否正确放置。

  • mina 部署 rails 时出错 at October 29, 2013

    database configuration does not specify adapter

    database.yml 有问题

  • Net::HTTP get 方法 at October 29, 2013

    开发模式用的 webrick 只能接受一个 request,换 passenger,unicorn,thin 看看。

  • 结束了,感受嘛? at October 28, 2013

    :shipit: emojihub

  • RubyConf China 第一日参会感受 at October 27, 2013

    pm2.5 290 了,大家没白来

  • RubyConf China 第一日参会感受 at October 26, 2013

    #28 楼 @Tony612 有,两晚也都去了,我明天到会场之后在推特发我座号吧。

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