{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/268","repository_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/268/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/268/events","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/268","id":152557244,"number":268,"title":"404 not found when posting","user":{"login":"V4Vince","id":17656924,"avatar_url":"https://avatars.githubusercontent.com/u/17656924?v=3","gravatar_id":"","url":"https://api.github.com/users/V4Vince","html_url":"https://github.com/V4Vince","followers_url":"https://api.github.com/users/V4Vince/followers","following_url":"https://api.github.com/users/V4Vince/following{/other_user}","gists_url":"https://api.github.com/users/V4Vince/gists{/gist_id}","starred_url":"https://api.github.com/users/V4Vince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/V4Vince/subscriptions","organizations_url":"https://api.github.com/users/V4Vince/orgs","repos_url":"https://api.github.com/users/V4Vince/repos","events_url":"https://api.github.com/users/V4Vince/events{/privacy}","received_events_url":"https://api.github.com/users/V4Vince/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-02T13:50:03Z","updated_at":"2016-05-02T14:32:44Z","closed_at":null,"body":"I'm getting a 404 not found when I try to post my story. The object is being created, but it wont post to the database. Also, I noticed that the object has no ID\r\n\r\nThis is the object: \r\n```console\r\ndata\r\nObject {stories: Object, submit: \"Submit\"}stories: Objectbody: \"asdasdad\"title: \"asdasd\"__proto__: Objectsubmit: \"Submit\"__proto__: Object\r\n```\r\n\r\nThis is the error:\r\n```console\r\njquery.js:9203 POST http://localhost:3000/stories/ 404 (Not Found)send @ jquery.js:9203jQuery.extend.ajax @ jquery.js:8684createStory @ api.js:67(anonymous function) @ events.js:42jQuery.event.dispatch @ jquery.js:4737elemData.handle @ jquery.js:4549\r\nui.js:11 Object {readyState: 4, responseText: \"{\"error\":{\"message\":\"Not Found\"}}\", responseJSON: Object, status: 404, statusText: \"Not Found\"}failure @ ui.js:11fire @ jquery.js:3187self.fireWith @ jquery.js:3317done @ jquery.js:8787(anonymous function) @ jquery.js:9151\r\n```\r\n\r\nMy AJAX request:\r\n```js\r\nconst createStory = (success, failure, data) => {\r\n  debugger;\r\n  console.log(appURL.data);\r\n  $.ajax({\r\n    method: 'POST',\r\n    url: appURL.link + '/stories/',\r\n    data,\r\n    headers: {\r\n      Authorization: 'Token token=' + appURL.user.token,\r\n    },\r\n  }).done(success)\r\n    .fail(failure);\r\n};\r\n```\r\nmy event handler:\r\n```js\r\n  $('#submit-story-form').on('submit', function(event){\r\n      event.preventDefault();\r\n      let data = getFormFields(this);\r\n      authApi.createStory(authUi.createStorySuccess, authUi.failure, data);\r\n  });\r\n```\r\nmy controller:\r\n```ruby\r\nclass StoriesController < ApplicationController\r\n  before_action :set_story, only: [:create, :show, :update, :destroy]\r\n\r\n  # POST /stories\r\n  # POST /stories.json\r\n  def create\r\n    @story = Story.new(story_params)\r\n\r\n    if @story.save\r\n      render json: @story, status: :created, location: @story\r\n    else\r\n      render json: @story.errors, status: :unprocessable_entity\r\n    end\r\n  end\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/comments/216251348","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/268#issuecomment-216251348","issue_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/268","id":216251348,"user":{"login":"V4Vince","id":17656924,"avatar_url":"https://avatars.githubusercontent.com/u/17656924?v=3","gravatar_id":"","url":"https://api.github.com/users/V4Vince","html_url":"https://github.com/V4Vince","followers_url":"https://api.github.com/users/V4Vince/followers","following_url":"https://api.github.com/users/V4Vince/following{/other_user}","gists_url":"https://api.github.com/users/V4Vince/gists{/gist_id}","starred_url":"https://api.github.com/users/V4Vince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/V4Vince/subscriptions","organizations_url":"https://api.github.com/users/V4Vince/orgs","repos_url":"https://api.github.com/users/V4Vince/repos","events_url":"https://api.github.com/users/V4Vince/events{/privacy}","received_events_url":"https://api.github.com/users/V4Vince/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T14:32:44Z","updated_at":"2016-05-02T14:32:44Z","body":"The private story params method I have in my StoriesController is \r\n\r\n```ruby\r\nprivate\r\n\r\n    def set_story\r\n      @story = Story.find(params[:id])\r\n    end\r\n    # added this line\r\n    def story_params\r\n      params[:stories]\r\n    end\r\nend\r\n```"}}