{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/803","repository_url":"https://api.github.com/repos/ga-wdi-boston/capstone-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/803/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/803/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/803/events","html_url":"https://github.com/ga-wdi-boston/capstone-project/issues/803","id":253177346,"number":803,"title":"curl for update not working","user":{"login":"3point14guy","id":28842407,"avatar_url":"https://avatars0.githubusercontent.com/u/28842407?v=4","gravatar_id":"","url":"https://api.github.com/users/3point14guy","html_url":"https://github.com/3point14guy","followers_url":"https://api.github.com/users/3point14guy/followers","following_url":"https://api.github.com/users/3point14guy/following{/other_user}","gists_url":"https://api.github.com/users/3point14guy/gists{/gist_id}","starred_url":"https://api.github.com/users/3point14guy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3point14guy/subscriptions","organizations_url":"https://api.github.com/users/3point14guy/orgs","repos_url":"https://api.github.com/users/3point14guy/repos","events_url":"https://api.github.com/users/3point14guy/events{/privacy}","received_events_url":"https://api.github.com/users/3point14guy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-27T17:26:08Z","updated_at":"2017-08-27T21:18:28Z","closed_at":"2017-08-27T21:18:28Z","body":"Getting the following error when trying to do a curl request for update:\r\n\r\n![image](https://user-images.githubusercontent.com/28842407/29752410-679dd68e-8b2b-11e7-9e05-3aa6afc705e1.png)\r\n\r\nI am having difficulty figuring out what this part: {\"error\":{\"message\":\"Not Found\"}} is referring to.  I feel like it is coming from the controller, but I am not sure about what I should do next.\r\n\r\nCURL:\r\n```sh\r\n  API=\"${API_ORIGIN:-http://localhost:4741}\"\r\n  URL_PATH=\"/vegetables/$ID\"\r\n  curl \"${API}${URL_PATH}\" \\\r\n    --include \\\r\n    --request PATCH \\\r\n    --header \"Content-Type: application/json\" \\\r\n    --header \"Authorization: Token token=BAhJIiU4ZTVhZTZlNTI5NWQ2OTFjOTI4ZTBmMWJlOTk3MWU1MwY6BkVG--07e25743e5fcd16db41b37f1d1f9ca95870ea429\" \\\r\n    --data '{\r\n      \"vegetable\": {\r\n        \"name\": \"Corn\",\r\n        \"image\": \"http://i.imgur.com/IysO0qE.jpg\",\r\n        \"comment\": \"4 rows planted\"\r\n      }\r\n    }'\r\n```\r\ncontroller:\r\n```rb\r\nclass VegetablesController < ApplicationController\r\n  before_action :set_vegetable, only: [:show, :update, :destroy]\r\n\r\n  # GET /vegetables\r\n  def index\r\n    @vegetables = Vegetable.all\r\n\r\n    render json: @vegetables\r\n  end\r\n\r\n  # GET /vegetables/1\r\n  def show\r\n    render json: @vegetable\r\n  end\r\n\r\n  # POST /vegetables\r\n  def create\r\n    @vegetable = Vegetable.new(vegetable_params)\r\n\r\n    if @vegetable.save\r\n      render json: @vegetable, status: :created, location: @vegetable\r\n    else\r\n      render json: @vegetable.errors, status: :unprocessable_entity\r\n    end\r\n  end\r\n\r\n  # PATCH/PUT /vegetables/1\r\n  def update\r\n    if @vegetable.update(vegetable_params)\r\n      render json: @vegetable\r\n    else\r\n      render json: @vegetable.errors, status: :unprocessable_entity\r\n    end\r\n  end\r\n\r\n  # DELETE /vegetables/1\r\n  def destroy\r\n    @vegetable.destroy\r\n  end\r\n\r\n  private\r\n    # Use callbacks to share common setup or constraints between actions.\r\n    def set_vegetable\r\n      @vegetable = Vegetable.find(params[:id])\r\n    end\r\n\r\n    # Only allow a trusted parameter \"white list\" through.\r\n    def vegetable_params\r\n      params.require(:vegetable).permit(:name, :image, :comments)\r\n    end\r\nend\r\n```\r\nschema:\r\n```rb\r\ncreate_table \"vegetables\", force: :cascade do |t|\r\n    t.string   \"name\",       null: false\r\n    t.string   \"image\",      null: false\r\n    t.text     \"comments\"\r\n    t.datetime \"created_at\", null: false\r\n    t.datetime \"updated_at\", null: false\r\n  end\r\n```\r\nroutes:\r\n```rb\r\n# frozen_string_literal: true\r\nRails.application.routes.draw do\r\n  post '/sign-up' => 'users#signup'\r\n  post '/sign-in' => 'users#signin'\r\n  delete '/sign-out/:id' => 'users#signout'\r\n  patch '/change-password/:id' => 'users#changepw'\r\n  resources :users, only: [:index, :show]\r\n  resources :vegetables, except: [:new, :edit]\r\n  resources :examples, except: [:new, :edit]\r\nend\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/comments/325225425","html_url":"https://github.com/ga-wdi-boston/capstone-project/issues/803#issuecomment-325225425","issue_url":"https://api.github.com/repos/ga-wdi-boston/capstone-project/issues/803","id":325225425,"user":{"login":"3point14guy","id":28842407,"avatar_url":"https://avatars0.githubusercontent.com/u/28842407?v=4","gravatar_id":"","url":"https://api.github.com/users/3point14guy","html_url":"https://github.com/3point14guy","followers_url":"https://api.github.com/users/3point14guy/followers","following_url":"https://api.github.com/users/3point14guy/following{/other_user}","gists_url":"https://api.github.com/users/3point14guy/gists{/gist_id}","starred_url":"https://api.github.com/users/3point14guy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3point14guy/subscriptions","organizations_url":"https://api.github.com/users/3point14guy/orgs","repos_url":"https://api.github.com/users/3point14guy/repos","events_url":"https://api.github.com/users/3point14guy/events{/privacy}","received_events_url":"https://api.github.com/users/3point14guy/received_events","type":"User","site_admin":false},"created_at":"2017-08-27T21:18:28Z","updated_at":"2017-08-27T21:18:28Z","body":"I was trying to update an ID that didn't exist.  Other item IDs will update."}}
{"actor":{"display_login":"3point14guy"}}