Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
ian
@doitian
高级会员
第 186 位会员 / 2011-11-23

皮匠科技
杭州
22 篇帖子 / 849 条回帖
42 关注者
1 正在关注
13 收藏
GitHub Public Repos
  • live2dviewer 76

    Live2D 模型批量查看器

  • dotfiles-public 14

    My configurations

  • knowledge-base 5

  • ckb-sdk-python 2

  • readwise-scripts 2

  • zotero-actions-tags-sc... 2

    Scripts for the Zotero plugin windingwind/zotero-actions-tags

  • lnd-grpc-tonic-client 2

    Rust lnd client using tonic and tonic-openssl.

  • http-inspector 1

  • dotfiles 1

    dotfiles managed using saltstack

  • userstyles 0

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 大家都用什么制作文档 at 2013年01月05日

    yardoc 不是生成文件到 doc 下了吗。mongoid 只需要加个宏让 yardoc 给 field 生成注释就行了。

    http://rubydoc.info/docs/yard/file/docs/GettingStarted.md#Macros

    attach 到 field 方法上,(类型是个 Hash,可能不好提取)

    # @!macro [attach] mongoid.field
    # @return [Object] the $1 $0 of the post
    property :title, :type => String
    
  • 总结教训 at 2013年01月05日

    @bhuztez 是因为有个 bug 只有 production 环境才能重现 https://github.com/ruby-china/ruby-china/pull/143

  • [已解决] rails_admin 满眼的 translation missing,求解 at 2013年01月05日

    添加新的翻译文件需要重启下

  • 2012年12月21日以后的数据丢失了 at 2013年01月05日

    @huacnlee 我还以为被我测试测挂了

  • 如何用 MIGRATION,不用 SQL 修改 column 的 default 值 at 2012年12月20日

    #1 楼 @5long 一直是 change_column 还得把类型再列一遍,去掉就是 :default => nil。有这个 API 方便多了

  • 做一个作业系统,怎么实现其权限系统? at 2012年12月20日

    rolify 也可以把 role 绑定到某个资源上,首页第一个例子就是

    user.has_role?(:moderator, Forum.first)

    更多例子 add-a-role-to-a-user

    cancan 可以加 condition 定义那些资源能够访问,不过规则要么自己静态定义在 ability.rb 里,要么配合 rolify 使用

  • Rails4 重大设计决策:“胖” Model 用 ActiveSupport::Concern 瘦身 at 2012年12月20日

    http://blog.bignerdranch.com/1304-breaking-table-model-controller-symmetry/ 这个 post 不错

  • 想请教下 ||=与=的区别,||=是在什么情况下使用比较合适 at 2012年12月20日

    ||= 经常用来做 cache,有些资源需要计算或者从外部去获取,你不想每次调用重复去计算或者连接数据库就用 ||=

  • 跟大家来分享下我最近在做的项目:webruby at 2012年12月19日

    机器吃不消啊,转了好久才加载完

  • wiki 指南 sed 这一步出错 (mac)(解决,谢谢,建议改一下 wiki) at 2012年12月19日

    bsd 的 find, sed 都和 Linux 有些不一致的地方

  • assets 下如何修改 stylesheet 目录为 css?谢谢 at 2012年12月19日

    可以 config.assets.append_path Rails.root.join('app/assets/css') 不过 generators 都写死了没法改的,把 stylesheets 的 generators disable 掉自己手动加。

  • 用 Bootstrap 的哥们,你们是怎么居中的? at 2012年12月18日

    #3 楼 @QueXuQ 可以加个 class

    .center {
      width: auto;
      display: table;
      margin-left: auto;
      margin-right: auto;
    }
    .text-center {
      text-align: center;
    }
    
    
    <div class="center">
      pla pla pla
    </div>
    
  • 期末了,linux 下开发 J2EE at 2012年12月18日

    编译,运行,部署可以交给 maven,调试就直接 jdb 命令行上。vim 就专心编辑,弄些方便文件间转的插件和一些 snippets (Java 不用 snippets 应该会很痛苦)。我记得 eclipse 有插件可以用 vim 做编辑器吧,不要为了用 vim 而用 vim,eclipse 的重构等功能对于写 J2EE 还是很方便的。

  • 求证是否正确:REST 的理解 at 2012年12月18日

    多看看优秀的 REST 实现: http://developer.github.com/v3/

    Hypermedia 是 REST 很重要的一环,Rails 本身不支持。

  • 用 Bootstrap 的哥们,你们是怎么居中的? at 2012年12月18日

    block 没设定宽度是不能 margin auto 来居中的,一个简单的办法是 display: table

    PS:

    display: table
    width: auto
    margin-left: auto
    margin-right: auto
    
  • Heroku 上的 dyno 與 worker at 2012年12月18日

    开发的话 resque, sidekiq 这些可以需要时手动 resque run 跑一跑,就不用增加 worker 了

  • markdown 能用 html 包裹 md 格式的内容吗?怎样做? at 2012年12月18日

    https://github.com/mojombo/jekyll/wiki/configuration

    markdown 换成 kramdown

  • markdown 能用 html 包裹 md 格式的内容吗?怎样做? at 2012年12月17日

    取决于你用的 markdown 是不是实现了这个功能。markdown="1" 是 PHP markdown extra 里的扩展,有些 Ruby 实现像 kramdown 是支持的,大部份像 redcarpet 是不支持的

  • Javascript 跨子域通讯 at 2012年12月16日

    server 能控制的话 cors 也就是加些 headers 的事

  • 关于 win 平台开发 Ruby 的情况 at 2012年12月15日

    主要是 Windows 命令行太难用了,power-shell 稍微好点。强烈建议用 Windows 环境的看看 http://jbeckwith.com/2012/11/28/5-steps-to-a-better-windows-command-line/

  • gistflow.com 上有不少有意思的 ruby tips,有空大家可以看看 at 2012年12月15日

    gist 竟然都不是 embed 进去的

  • 成都的 Ruby/Rails 开发者 -- 请加 qq 群, 邮件组 at 2012年12月12日

    长期呆家里了?

  • 发起新的开源项目 - 19 屋,招募贡献者 at 2012年12月10日

    +1

  • 我们如何在项目使用 Spine.JS 的. at 2012年12月05日

    #1 楼 @jokry 我看的例子都是暴力 select

  • html 页面自动截取 at 2012年12月05日

    #2 楼 @sapronlee 打开页面后保存,用 html check 工具查下是不是有标签没闭合

  • Coffee script & Javascript 结构与组织 at 2012年12月05日

    #13 楼 @lentg 最简单就是用 public/system , cap 默认就 link 了。

  • Coffee script & Javascript 结构与组织 at 2012年12月04日

    #8 楼 @lentg 就是通过 Rails 在 view 里控制 js 的执行路径啊。敲了个简单的例子,可以在 controller 里进行控制 https://gist.github.com/4200680 (直接网页敲的,没测试,意思到了就好)

  • 多台服务器同步配置文件 at 2012年11月29日

    #25 楼 @yakjuly 很多 cookbook 确实只能弄单实例,部署很少会在一台机器部署一堆东西吧。chef 中可以通过配置和模板配合。

    配置可以是个数组,每个实例对应一个数组成员,foreach 一下就好。最好在加个 definition,方便调用。比如 monit 就是个典型的需要多实例的:https://github.com/apsoto/monit/blob/master/definitions/monitrc.rb

  • Coffee script & Javascript 结构与组织 at 2012年11月28日

    总结得很好,我一般用 Solution 3

  • 请问各位是怎么样才本地测试 production 模式的呢? at 2012年11月22日

    可以在本地部署份,文件夹分开了就不冲突了

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