Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Brad
@jpman
VIP
NO. 3980 / 2012-10-09

[email protected]
北京
0 Topics / 28 Replies
1 Followers
7 Following
75 Favorites
GitHub Public Repos
  • texture 0

    Texture JATS XML editor integration for OJS

  • ohmyzsh 0

    🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh conf...

  • select2 0

    Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, ...

  • ckeditor 0

    Ckeditor 4.x integration gem for rails

  • react-select 0

    A Select control built with and for React JS

  • bootstrap-datetimepicker 0

    Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)

  • NewEBuy 0

    New Edition And New Design

  • shadowsocks 0

  • texmath 0

    A Haskell library for converting LaTeX math to MathML.

  • ShadowVPN 0

    A fast, safe VPN based on libsodium

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 求问 create! 报错和 rescue 之间的关系 at October 13, 2016

    #14 楼 @smartepsh render status: 403 等于 render status: :forbidden 至于render head: :forbidden 我特意用了 rails 5 试了一下就是 返回 200

  • 求问 create! 报错和 rescue 之间的关系 at October 13, 2016
    为什么不会按照猜想走,为什么不会报错?

    因为 resuce 截获了异常

    为什么渲染了200 OK……?

    如果是 403 应该这么写 render status: :forbidden

  • 有关 Rails 路由设计的最佳实践 at October 08, 2016

    #6 楼 @lilijreey http://guides.rubyonrails.org/routing.html#advanced-constraints 你可以多看看文档

  • [已解决] rails 如何导入自定义 xls at July 27, 2016

    Spreadsheet 不支持 xlsx 导入 https://github.com/zdavatz/spreadsheet/issues/77 Spreadsheet 作者推荐用 RubyXL

  • 碰到 Assets Pipeline 里的 “幽灵文件”,我被自己给逗乐了 at March 25, 2016

    所以,application 里 require 的优先级应该是 coffee 和 sass 大于 js 和 css 的吧。

    http://guides.rubyonrails.org/asset_pipeline.html#asset-organization 这个才是真正的原因

  • 控制器中的实例对象? at March 01, 2016

    #9 楼 这里我查了一下 api 发现 render 'new' 会自动转换成 render action: 'new'. 但是我在这个 controller 里没有定义 new action 的时候 依然可以正常渲染, 于是我又 google 了一下 发现了这篇文章 http://climber2002.github.io/blog/2015/02/21/how-rails-finds-your-templates-part-1/ 这里 render 方法 找到 template 文件 的全过程。

     if (options.keys & [:partial, :file, :template]).empty?
       options[:prefixes] ||= _prefixes
     end
    
    options[:template] ||= (options[:action] || action_name).to_s
    

    当没有 option[:template] 的时候 , 会得到一个 options[:prefixes], 然后 option[:action] 会赋值给 option[:template]

    所以这里 render action: 'new' 和 controller 里的 new action 是没有任何关系的。

  • 控制器中的实例对象? at March 01, 2016

    #5 楼 @wwwicbd render new 只是负责把你的 new.html.erb 模版渲染成 html 而已。 你这里说的渲染方法和提交方法没有任何关联,如果你想让 url 变成 http://localhost:3000/articles/new. 你需要用 redirect_to

  • 送几本《AngularJS 学习手册》 at January 06, 2016

    拉低中奖率

  • 解决 stack level too deep 问题 at January 06, 2016

    #23 楼 @runup mouse 不是变量,这个只是 mouse() 的另一种写法而已。

  • 两段元编程代码的疑问 at December 25, 2015

    匿名类就是没有名字的类 😄

    c = Class.new(Array)
    c.name  #=>nil
    
  • Rails 怎么提交表单,怎么传递 URI? at November 30, 2015

    这个问题和 rails 无关

  • Mac 下 Sublime 的 folder side bar,每次关闭 Sublime 后 side bar 都会清空里面的文件列表 at October 26, 2015

    保存成一个 project 就可以了 下次用的时候切换一下就好了 https://www.google.com.hk/#safe=strict&q=sublime+project

  • 做 Web 前后端开发,Mac 苹果电脑,是最佳装备吗 at October 20, 2015

    楼主还是用 3000 块笔记本吧 给你用肯定是浪费的

  • 欢迎 3 位新的 Ruby China 社区管理员 at October 14, 2015

    👍

  • 这在 Rails 里也是默认的吗 (where 前没有 object)? at September 21, 2015

    这种写法和 rails 无关,调用 where 的是 self, 而这里 self 指向的是 User.

  • [上海] 哔哩哔哩-诚邀 Ruby 工程师-还在继续! at July 03, 2015

    B 站!

  • 乐享圣诞,喜迎新年抽奖活动(截止日期:2015.1.2) at December 26, 2014

    66666

  • 一个简单的路由问题 at November 12, 2014

    1 楼应该是正解。你得理解是错得

  • 你所不知道的 console 对象的五个函数 (功能) at November 11, 2014

    👏

  • Koding 邀请用户送空间活动 at March 05, 2014

    https://koding.com/R/ibrad

  • Peatio (貔貅) 电子加密货币交易所准备开源并征集内测用户 at February 17, 2014

    [email protected]

  • [奖品图曝光] UPYUN 送上情人节三件套,祝大家码上有爱情 at February 11, 2014

    苍老师!dreamfanbin at gmail.com

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