Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
rdongxie
@rdongxie
Member
NO. 14132 / 2014-07-18

linktracing.com
南京
8 Topics / 41 Replies
1 Followers
3 Following
4 Favorites
GitHub Public Repos
  • RedMind 3

    MindMap

  • vimfiles 1

    The ~/.vim directory that we share at work

  • Mr.Coverage 1

    node js-coverage using Mocha

  • Spoon-Knife 1

    This repo is for demonstration purposes only. Comments and issues may or may not be responded to.

  • django-twoscoops-project 1

    The sample project layout from the book, "Two Scoops of Django: Best Practices for Django 1.5"

  • simplemde-markdown-editor 1

    A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell che...

  • pagedown 0

    Automatically exported from code.google.com/p/pagedown

  • playback 0

    Video player build using atom-shell and node.js

  • dubbo 0

    Apache Dubbo is a high-performance, java based, open source RPC framework.

  • Douban-FM-Express 0

    DoubanFM Desktop Client Powered by Atom-shell.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • ruby-china 代码 controller 里面 action 为什么都没有 respond_to at October 30, 2014

    #4 楼 @flowerwrong jquery_ujs 仅仅是 ajax 调用吧,没有涉及到 controller。jquery_ujs 发送请求 MIME_TYPE:application/javascript。

  • ruby-china 代码 controller 里面 action 为什么都没有 respond_to at October 30, 2014

    #1 楼 @cisolarix 在 create 中没有写下面这段代码也是可以个根据 MIME 类型做不同的输出吧:

    respond_to do |format|
          if @course.save
            format.html { redirect_to @course, notice: 'Course was successfully created.' }
            format.json { render :show, status: :created, location: @course }
          else
            format.html { render :new }
            format.json { render json: @course.errors, status: :unprocessable_entity }
          end
        end
    

    ruby-china 的回复帖子功能里面,返回的就是 create.js.erb.而在 create 里面没有 respond_to,只有如下代码:

    def create
        @reply = Reply.new(reply_params)
        @reply.topic_id = @topic.id
        @reply.user_id = current_user.id
    
        if @reply.save
          current_user.read_topic(@topic)
          @msg = t('topics.reply_success')
        else
          @msg = @reply.errors.full_messages.join('<br />')
        end
      end
    
  • Let's Party! at October 29, 2014

    i find this~~~i must say thank you to huacnlee

  • 编写 Ruby 的 C 扩展 at October 29, 2014

    👍

  • Rails 3.2 升级到 Rails 4 中遇到的问题 at October 29, 2014

    👍

  • ActiveRecord 的三种数据预加载形式 - includes, preload, eager_load at October 29, 2014

    rails4 不能使用 attr_accessible 了吧

  • [上海,南京] 暴走漫画诚聘各方英才 at August 05, 2014

    河定桥?

  • 南京的 weber rubyer 有没有想法 聚一聚啊 at August 05, 2014

    建立个 QQ 群吧~~这个发贴聊天~~一直 F5 么?

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