Rails: Too Few Arguments

前端 未结 1 1735
借酒劲吻你
借酒劲吻你 2021-01-01 09:07

I am trying to get some Javascript working in my Rails app.

I want to have my index page allow me to edit individual items on the index page, and then reload the in

1条回答
  •  独厮守ぢ
    2021-01-01 09:39

    You forgot to write responds_to block:

    def update
      @holder = Holder.find(params[:id])
      if @holder.update_attributes(params[:holder])
        respond_to do |format|
          format.html { redirect_to holders_path } #, flash[:success] = "holder updated")
          format.js
        end
      else
        render 'edit'
      end
    end
    

    But I am suspicious about your index.html.erb, I don't think that will really work the way you think.

    0 讨论(0)
提交回复
热议问题