Rails: render doesn't work, still get `Template is missing`

后端 未结 5 765
一个人的身影
一个人的身影 2021-02-02 08:59

I am currently learning Rails Guides. I went through the steps but still encountered a mistake.

My Ruby version is ruby 2.1.1p76 and the Rails version is

5条回答
  •  太阳男子
    2021-02-02 09:42

    You no need template means you could use render nothing: true

    Try like this:

    class ArticlesController < ApplicationController
     def new
     end
    
     def create
      params[:article].inspect
      render nothing: true
     end
    end
    

    Please refer this link click here

提交回复
热议问题