Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 使用继承的_资源gem时未显示闪存消息_Ruby On Rails_Inherited Resources - Fatal编程技术网

Ruby on rails 使用继承的_资源gem时未显示闪存消息

Ruby on rails 使用继承的_资源gem时未显示闪存消息,ruby-on-rails,inherited-resources,Ruby On Rails,Inherited Resources,当我在控制器中使用默认IC动作时,如下所示: def update update!(:notice => "Order has been updated."){edit_sales_order_path(@sales_order)} end 通知没有显示在我的json响应中。但是,如果我像这样覆盖操作,它会工作 if @sales_order.update_attributes(permitted_params[:sales_order])

当我在控制器中使用默认IC动作时,如下所示:

    def update
      update!(:notice => "Order has been updated."){edit_sales_order_path(@sales_order)}
    end
通知没有显示在我的json响应中。但是,如果我像这样覆盖操作,它会工作

    if @sales_order.update_attributes(permitted_params[:sales_order])
      flash[:notice] = "Order has been updated"
    else
有什么想法吗