Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
railsweb
@railsweb
Member
NO. 11936 / 2014-03-06

[email protected]
1 Topics / 6 Replies
0 Followers
0 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • jbuilder 如何输出 带.的 key at April 16, 2014

    #7 楼 @cxh116 谢谢!代码清爽多了。谢谢!

  • jbuilder 如何输出 带.的 key at April 15, 2014

    #4 楼 @cxh116 不好意思,麻烦又来了,求助: 按照您的方法,提示: undefined local variable or method `json' for #<#Class:0x007fcd58a254b8:0x007fcd5a201410>

    函数里的 json.set! json 不识别

  • jbuilder 如何输出 带.的 key at April 15, 2014

    #4 楼 @cxh116 真的非常感谢!

  • jbuilder 如何输出 带.的 key at April 15, 2014

    #1 楼 @cxh116 高手,感谢您的指导。再请教一下:我现在改成 json.success true json.data do # json.extract! @customer, :id, :code, :name, :sex, :birthday, :address, :comment json.set! 'customer.id', @customer.id json.set! 'customer.name', @customer.name json.set! 'customer.sex', @customer.sex json.set! 'customer.birthday', @customer.birthday json.set! 'customer.address', @customer.address json.set! 'customer.comment', @customer.comment end 可以输出 {"success":true,"data":{"customer.id":1,"customer.name":"张三丰","customer.sex":"男","customer.birthday":null,"customer.address":"","customer.comment":""}} 就是那个模板 能不能再简化一下啊。每个都要输入 json.set!

  • jbuilder 如何输出 带.的 key at April 15, 2014

    #1 楼 @cxh116 可以了。谢谢了!

  • 论 Rails 跑在 Windows 的可能行 at March 06, 2014

    己经做了好几个项目了,都部署 win 2003 上,运行快 | 年了,很稳定啊!

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