Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
dddx
@dddx
会员
第 25791 位会员 / 2016-03-30

[email protected]
3 篇帖子 / 26 条回帖
0 关注者
0 正在关注
0 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 感觉现在 ruby-china 的样式包括通知比之前丑了 at 2016年05月10日

    而且标题最上面被 hidden 了一点点。。。。。。。。(火狐浏览器)设置下 line height 会好一点

  • [转载] 元编程之重写 will_paginate at 2016年05月10日

    纯 css 就可以~~~~~

  • 各位能否把 JavaScript 这个板块搞活跃起来? at 2016年05月05日

    #3 楼 @nightire 给钱?哈哈

  • Nginx + Rails 下如何进行文件的安全下载? at 2016年04月29日

    #7 楼 @xueron 你看文档啊.... 后面加 ?attname= 就可以了

  • 树莓派 3 中启动 Rails,其他电脑透过网络无法访问该站 at 2016年04月22日

    rails s -b 0.0.0.0 -p 3000 或者 rvmsudo rails s -b 0.0.0.0 -p 3000

  • Rails 有没有伪静态,有必要伪静态吗 at 2016年04月22日

    #1 楼 @acaby 可不可以 link_to 点出来就是这个

  • Rails 有没有伪静态,有必要伪静态吗 at 2016年04月22日

    #3 楼 @huacnlee 谢谢,同时培养 提高自己阅读英文文档的能力

  • Rails 有没有伪静态,有必要伪静态吗 at 2016年04月22日

    #4 楼 @huobazi 嗯 牛逼 如何码 让你的 link_to 点出来就是这个~~

  • Rails 有没有伪静态,有必要伪静态吗 at 2016年04月22日

    #1 楼 @acaby 这个是我自己的!....

  • 奇怪的 Rails 问题 at 2016年04月21日

    或许我没有描述清楚 查询代码不是一样的嘛 我觉得你现在可以再试试了.... 应该没问题的 1 楼

  • 奇怪的 Rails 问题 at 2016年04月21日

    Contract.where("contract.name like 'ww.'").includes(:partner_relationship) Contract.where("contract.name like 'w.'").includes(:partner_relationship) 确实是一样的... 不过提示 Table 'fwrpm_oltp.relationship' doesn't exist 很明显你的表那会没找到... 可能:有别人和你一起开发而 DB 版本不一样

  • DDOS 攻击如何取证 at 2016年04月14日

    #4 楼 @wmzsonic 我那直接把服务器搞崩掉了 我是小白 但是查查得知应该是一句话木马 里面有什么 eval($_post['eval']) 草

  • DDOS 攻击如何取证 at 2016年04月14日

    楼主啥情况.... 我不懂啥事 DDos 之前用 apache+php 的时候 经常被 azenv.php 骚扰 网站还多了几个文件 好烦

  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月14日

    #16 楼 @rei 这样确实简洁 不过.... 能这样使用不 @product.update(product_params)

  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月13日

    #13 楼 @zlx_star 看了你的资料,才发现世界很小,我 也姓祝...字辈:瑞映山庄,和 (河) 东风起,厚德呈祥 我在 [风]

  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月13日

    #13 楼 @zlx_star 好嘞

  • Rails 404 等页面咋使用咱们 layouts 里面的 dom 和 style 啊 at 2016年04月13日

    #6 楼 @cysh 我主要说 这里面要使用公共的头尾是不是比较麻烦?!

  • [北京] 趣玩贝公司招聘 Ruby 开发 1 名 (15k-30k) at 2016年04月13日

    ror 新手表示看看

  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月13日

    发现有时候思维就是卡住,我自己想到一个办法,感觉比以上都简单.... 这个方法呢,我没有试,但我感觉一定行 (只是感觉哦...试试了后我来更新)

    def create
      @product = Product.new(product_params)
      @product.price *= 2 
      if @product.save
        ...
      else
        ...
      end
    end
    
  • Rails 404 等页面咋使用咱们 layouts 里面的 dom 和 style 啊 at 2016年04月13日

    当然了 我纳闷 这个需求应该不止我一个人 为什么 rails 默认放到 public 呢....

  • Rails 404 等页面咋使用咱们 layouts 里面的 dom 和 style 啊 at 2016年04月13日

    good 我来做一下搬运工

    application_controller.rb

    def render_404
      render_optional_error_file(404)
    end
    
    def render_403
      render_optional_error_file(403)
    end
    
    def render_optional_error_file(status_code)
      status = status_code.to_s
      fname = %w(404 403 422 500).include?(status) ? status : 'unknown'
      render template: "/errors/#{fname}", format: [:html],
             handler: [:erb], status: status, layout: 'application'
    end
    
  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月12日

    #2 楼 @zlx_star 这个 class Prodcut 是 class ProductsController < ApplicationController 么,或者写在哪,好像是没起作用,求指点....或许我没有用对

  • Rails Model 保存或者更新的时候针对个别字段特殊处理怎么写方便 at 2016年04月12日

    #1 楼 @watraludru 你这个方法我试了,着实可行 赞 要这么用 @product.update(product_params.merge(price: product_params.fetch(:price) * 2))

  • Rails 部署问题 at 2016年03月31日

    #4 楼 @mumu hi 你解决了吧?

  • Rails 部署问题 at 2016年03月30日

    我最近也在折腾 rails 你的问题我也都遇到过 有些谷歌就解决了

    我建议多自己查和尝试 或者直接交流~~

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