Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Lixin
@QueXuQ
高级会员
第 3547 位会员 / 2012-09-05

260 篇帖子 / 537 条回帖
7 关注者
0 正在关注
5 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • text 类型的数据如何换行?(解决) at 2013年04月01日

    #9 楼 @chenge text 中,如果我输入:

    abx
    add
    

    在数据库中查看格式是这样的

    abx \r\n add
    

    直接输出到 html 里是:

    abx add
    

    而我希望的输出结果是:

    abx
    add
    

    直接 ruby.sub 是获取不到\r\n的,而且替换是直接变成
    然后插进去而已。要做 html 输出才可以,估计。

  • text 类型的数据如何换行?(解决) at 2013年04月01日

    #7 楼 @chenge 原来是 ruby 里的 sub。试了,这个方法是不可行的。

  • text 类型的数据如何换行?(解决) at 2013年04月01日

    #5 楼 @chenge 不好意思。不懂 sub 是什么来的?

  • text 类型的数据如何换行?(解决) at 2013年04月01日

    #3 楼 @chenge 嗯。输出的时候应该做什么处理?

  • text 类型的数据如何换行?(解决) at 2013年04月01日

    #1 楼 @chenge 是吗。搞错了,:simle: 请问怎么处理呢?

  • 关于 Javascript 的 MVC 的疑问 at 2013年03月28日

    #11 楼 @camel Thank you.<基于 MVC 的 JavaScript Web 富应用开发>看了,就是可惜没有介绍 Angular 和 Ember,所以不了解这两个情况,然后打算用 backbone。听你这样说,到是想入手试试 ember。 #12 楼 @darkbaby123 是的,我就是看了 Angular 后觉得很酷,目前还没有了解 ember。有机会试一试。 #13 楼 @knwang Thanks。

  • 模型装饰 draper gem 包 at 2013年03月26日

    这个很方便,把本来在 model 层的东西拨出来了。 取值装饰了,不知道赋值可以不可以装饰的?

  • 关于 Javascript 的 MVC 的疑问 at 2013年03月26日

    #8 楼 @darkbaby123 Backbone or AngularJS?

  • 推荐一个好用的 HTML5 播放器,jPlayer at 2013年03月22日

    #3 楼 @ywencn 好。感谢蜗牛哥。😄

  • 推荐一个好用的 HTML5 播放器,jPlayer at 2013年03月22日

    #1 楼 @ywencn Good . 然后用 paperclip-ffmpeg 转格式?

  • social-share-button 里没有分享微信朋友圈?想问问朋友圈有没有分享的? at 2013年03月21日

    #1 楼 @huacnlee http://open.weixin.qq.com/document/?lang=zh_CN 是不是有开放了朋友圈的 api 了?

  • 关于 Javascript 的 MVC 的疑问 at 2013年03月21日

    #4 楼 @winnie 我也看过这个,多个 ui,还没有去了解。 #3 楼 @metal 我好奇 javascript 是怎么掉用数据库的?应该是从 ruby 发送 json 过去用的吧。

  • 关于 Javascript 的 MVC 的疑问 at 2013年03月21日

    #1 楼 @nightire 哦。原来是 HTML5 Local Storage,因为本来 js 不能保存数据,我看里面又都是 js,就以为涉及了 nodejs。 前端好像越来越复杂,得仔细研究才行。谢谢。

  • 想看一些好的 Gem,来学什么写 Gem,还有深入了解 Ruby at 2013年03月21日

    #8 楼 @NonTwitter 重要想找些开源的东西写写。^_^ #7 楼 @hsming Railscasts 的看过。谢谢。

  • 做视频网站的同学,请问用什么转格式的? at 2013年03月15日

    ffmpeg -i xxx.mp4 xxx.webm也无法导出 webm。。。

  • 做视频网站的同学,请问用什么转格式的? at 2013年03月15日

    #1 楼 @southwolf #2 楼 @guyanbiao ffmpeg 用法貌似很复杂,都需要命令的,好强大。

  • 想看一些好的 Gem,来学什么写 Gem,还有深入了解 Ruby at 2013年03月14日

    #2 楼 @i5ting ruby 源码阿。。。看不了阿,没那么高技术。 #1 楼 @metal 恩。就是想问问有什么 gem,特别推荐而已。

  • highcharts-做图的 gem,我一直在维护,有需要的可以试验。 at 2013年03月14日

    #22 楼 @lsw521314 放在

    //= require jquery
    //= require jquery_ujs
    

    的下面。

  • 请问挎表应该怎么搜索好,MySQL at 2013年03月12日

    #7 楼 @Tony612 对。我也是 mysql2,joins 是可以的。但是 includes 就是不可以的。 includes 无论后面 where 里的表明是复数,还是单数或者不要,都不可以。 相反 joins 就可以。

  • 请问挎表应该怎么搜索好,MySQL at 2013年03月10日

    #3 楼 @xds2000 @Tony612 测试:

    irb(main):013:0> Fitting.all[0].stock.amount
      Fitting Load (3.1ms)  SELECT `fittings`.* FROM `fittings` ORDER BY id desc
      Stock Load (0.3ms)  SELECT `stocks`.* FROM `stocks` WHERE `stocks`.`fitting_id` = 1753 ORDER BY id desc LIMIT 1
    => #<BigDecimal:cdc1f84,'0.1E1',9(18)>
    

    使用:

    irb(main):017:0> Fitting.includes(:stock).where("stock.amount != ?", 0)
      SQL (1.4ms)  SELECT `fittings`.`id` AS t0_r0, `fittings`.`name` AS t0_r1, `fittings`.`price` AS t0_r2, `fittings`.`created_at` AS t0_r3, `fittings`.`updated_at` AS t0_r4, `fittings`.`selling_price` AS t0_r5, `fittings`.`barcode` AS t0_r6, `fittings`.`unit` AS t0_r7, `fittings`.`genre` AS t0_r8, `fittings`.`store_house_id` AS t0_r9, `fittings`.`shipping_space_id` AS t0_r10, `stocks`.`id` AS t1_r0, `stocks`.`amount` AS t1_r1, `stocks`.`fitting_id` AS t1_r2, `stocks`.`created_at` AS t1_r3, `stocks`.`updated_at` AS t1_r4, `stocks`.`alarm` AS t1_r5 FROM `fittings` LEFT OUTER JOIN `stocks` ON `stocks`.`fitting_id` = `fittings`.`id` WHERE (stock.amount != 0) ORDER BY id desc
    ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'stock.amount' in 'where clause
    
    irb(main):018:0> Fitting.includes(:stock).where("amount != ?", 0)
      Fitting Load (0.8ms)  SELECT `fittings`.* FROM `fittings` WHERE (amount != 0) ORDER BY id desc
    ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'amount' in 'where clause': SELECT `fittings`.* FROM `fittings`  WHERE (amount != 0) ORDER BY id desc
    

    上面都是不成功的。唯独下面的成功了,使用 joins 反而可以了。。

    irb(main):019:0> Fitting.joins(:stock).where("amount != ?", 0)
    

    不清除是什么个状况。

  • 库存管理数据库设计 ( 模版) at 2013年03月08日

    #1 楼 @rfidw 已经完成拉,打开就是按照我发的那个方式。不是那么复杂。还不知道什么叫存货核算呢。

  • Ruby-2.0.0-p0 at 2013年03月04日
    deploy@39:~$ gem install rubygems-update
    Successfully installed rubygems-update-2.0.0
    Parsing documentation for rubygems-update-2.0.0
    Done installing documentation for rubygems-update (0 sec).
    1 gem installed
    deploy@39:~$ update_rubygems
    RubyGems 2.0.0 installed
    Parsing documentation for rubygems-2.0.0
    Installing ri documentation for rubygems-2.0.0
    
    
    
    ------------------------------------------------------------------------------
    
    RubyGems installed the following executables:
        /home/deploy/.rvm/rubies/ruby-2.0.0-p0/bin/gem
    
    Ruby Interactive (ri) documentation was installed. ri is kind of like man 
    pages for ruby libraries. You may access it like this:
      ri Classname
      ri Classname.class_method
      ri Classname#instance_method
    If you do not wish to install this documentation in the future, use the
    --no-document flag, or set it as the default in your ~/.gemrc file. See
    'gem help env' for details.
    
  • Ruby-2.0.0-p0 at 2013年03月04日

    #56 楼 @ray 我解决你那个问题了,但是还有这样的问题。

    deploy@39:~$ gem -v
    2.0.0
    deploy@39:~$ gem install lazy_high_charts -v '1.3.3'
    ERROR:  Error installing lazy_high_charts:
        lazy_high_charts requires RubyGems version ~> 1.3. Try 'gem update --system' to update RubyGems itself.
    deploy@39:~$ gem update --system
    Latest version currently installed. Aborting.
    
  • 请问 http:// 和 https:// 的区别? at 2013年03月03日

    #1 楼 @ywencn 原来维基百科里的解释那么详细,谢谢。 这样说,不考虑 https 的最主要原因是因为不会被搜索爬虫搜索到了?

  • highcharts-做图的 gem,我一直在维护,有需要的可以试验。 at 2013年02月28日

    解决方法,升级 RubyGems。 http://rubygems.org/pages/download

    $ gem install rubygems-update  # again, might need to be admin/root
    $ update_rubygems              # ... here too
    
  • highcharts-做图的 gem,我一直在维护,有需要的可以试验。 at 2013年02月28日
    Installing lazy_high_charts (1.3.3) 
    Gem::InstallError: lazy_high_charts requires RubyGems version ~> 1.3. Try 'gem update --system' to update RubyGems itself.
    An error occurred while installing lazy_high_charts (1.3.3), and Bundler cannot continue.
    Make sure that `gem install lazy_high_charts -v '1.3.3'` succeeds before bundling.
    

    请问我升级 ruby 为 2.0 后,bundle install 就出现这个问题了。运行 update 后还是得不到解决。

  • Ruby China 开始用 Ruby 2.0 跑了 at 2013年02月28日
    Installing darkfish documentation for builder-3.1.4
    ERROR:  While executing gem ... (RDoc::Error)
        error generating /home/ray/.rvm/gems/ruby-2.0.0-p0/doc/builder-3.1.4/rdoc/doc/releases/builder-2_0_0_rdoc.html: U+201C from UTF-8 to US-ASCII (Encoding::UndefinedConversionError)
    

    不知道这是什么问题呢?bundle 不起来。

  • lazy_high_charts 1.2.2 稳定版发布。画图就用它了 at 2013年02月28日
    Installing lazy_high_charts (1.3.3) 
    Gem::InstallError: lazy_high_charts requires RubyGems version ~> 1.3. Try 'gem update --system' to update RubyGems itself.
    An error occurred while installing lazy_high_charts (1.3.3), and Bundler cannot continue.
    Make sure that `gem install lazy_high_charts -v '1.3.3'` succeeds before bundling.
    

    请问 Ruby2.0 后,为什么会出现上面的问题呢?

  • Ruby-2.0.0-p0 at 2013年02月27日

    #49 楼 @gaicitadie 同问。。😢

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