Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save williamromero/05bcede6b0fddab0df85b13c0e4f2cd7 to your computer and use it in GitHub Desktop.
Save williamromero/05bcede6b0fddab0df85b13c0e4f2cd7 to your computer and use it in GitHub Desktop.
Ajax Update Record

leads_controller.rb

    def activate
      # @leads = Lead.all.where("type = ? AND status = ?", Lead, true).order('id DESC').page(params[:page])
      @lead = Lead.find(params[:id])
      @lead.status = params[:status]
      @lead.save!
      respond_to do |format|
        format.js
      end       
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment