Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
JS
@boyishwei
会员
第 9634 位会员 / 2013-10-19

boyishwei@qq.com
10 篇帖子 / 214 条回帖
3 关注者
0 正在关注
28 收藏
GitHub Public Repos
  • douding 1

  • boyishwei 1

    my personal blog

  • eks-workshop-sample-ap... 0

    Sample Kubernetes service used in the EKS Workshop CI/CD CodePipeline module

  • mz 0

    mz

  • libakery 0

  • cgroovy 0

    Groovy-China

  • boyishwei-jekyll 0

    jekyll based blog

  • zhaobuxi 0

    zhaobuxi

  • groovy-weekly-cn 0

    Groovy Weekly in Chinese.

  • vue 0

    Simple yet powerful library for building modern web interfaces.

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 有没有用又拍云 Form API 上传的同学? at 2013年12月05日

    支持 upyun 的这种态度,纯为了 mark 一下 :)

  • 难道 Ubuntu 才是开发 Rails 的最佳环境? at 2013年12月05日

    某些程度上说,其实有个虚拟机也不错,方便移植,什么都不用配。比如新招个人,直接拷个最新虚拟机镜像给他,什么都不用配。哈哈,偷懒

  • ruby-china.org 的域名是 copy ruby-lang.org 的? at 2013年12月05日

    哈,原来 rubycn.org 也指向这里,good! 我觉得 rubychina.org 废掉了,估计 owner 期望卖个大价钱....

  • 能有人讲解下 response_to |format| 这块吗,一直没弄明白 at 2013年11月29日

    #3 楼 @iBachue people squared 上这两个视频很激励人

  • 能有人讲解下 response_to |format| 这块吗,一直没弄明白 at 2013年11月29日

    #7 楼 @Rei 是这样啊,谢谢了 Rei 再去看看 remote form 为什么不能支持文件上传,,,

  • 能有人讲解下 response_to |format| 这块吗,一直没弄明白 at 2013年11月29日

    谢谢两位 是的 1、通过 route 里面配置可以 force format 参数 2、通过资源格式可以决定 format 3、在 form 或者 link_to 等控件中加入 remote:true 参数,也会影响 format 参数(as JS)

    我现在遇到的问题也就在这个 format 上: 背景:图片上传 Gems

    gem 'mini_magick'
    gem 'carrierwave'
    

    Route resources :images

    在一个 form 中上传图片,提交方式采用 ajax 方式 Form 设定 form_for(@image, remote:true,

    代码片段

    <div class="field control-group">
      <%= f.label "上传图片", class:"control-label" %>
      <div class="controls">
        <%= f.file_field :instance %>
      </div>
    </div>
    

    问题: 如果不选择上传的图片文件, 然后提交, 跟预期一样,正常。这个时候的 format 是 JS,从以下可知道. Processing by ImagesController#create as JS

    但是一旦选择了要上传的图片文件,提交,format 就变成了 HTML, Processing by ImagesController#create as HTML, 也就不能正常调用预期的 create.js.erb。

    当然整个 action 正常运作,图片也已上传。

    问题就是,我就不知道为什么选了要上传文件后, format 就变了,导致页面不能正常跳转。

  • 能有人讲解下 response_to |format| 这块吗,一直没弄明白 at 2013年11月29日

    done~~ :)

  • ElasticSearch 初次使用小结,一起学习进步哈~ at 2013年11月12日

    顶起:)

  • Ruby Conf China 2013 After Party 小结 at 2013年10月31日

    赞一个,谢一个,有你们,才有这么强大的社区。。。。

  • 厌倦 Bootstrap 了没?来试试新玩具 at 2013年10月19日

    我也觉得这个是 bootstrap 的翻版,特地从头到尾把所有控件都看了一遍,感觉没 bootstrap 界面友好,不过还是谢谢 share....

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