title: Rails POST not working on Heroku but works locally
body: <p>I have an API that I use for an iPad app. The controller accepts json and returns json. POST requests work when I run the server locally and I use the ISO simulator but when I hit the POST request after I deploy to heroku all the params that I send over as JSON are nil. </p>
  
  <p>Watching the heroku logs I get the following when making the request.</p>
  
  <pre><code>    at=info method=POST path=/note/update host=myapp.herokuapp.com fwd="174.50.210.40" dyno=web.1 connect=0ms service=755ms status=500 bytes=643
  2013-04-11T16:51:30.907621+00:00 app[web.1]:
  2013-04-11T16:51:30.908272+00:00 app[web.1]: Processing by MyAPIController#update_note as JSON
  2013-04-11T16:51:30.908272+00:00 app[web.1]:   Parameters: {"myapi"=&gt;{}}
  2013-04-11T16:51:30.908272+00:00 app[web.1]: Completed 500 Internal Server Error in 551ms
  </code></pre>
  
  <p>My action in my controller looks like this. </p>
  
  <pre><code>def update_note
  
      puts "debug note update #{ params[:note] }"
  
      uuid = params[:uuid]
      user = User.find_by_uuid(uuid)
      noteid = params[:note][:note_id] if params[:note][:note_id]
  
      if !user.nil?
        note = nil
          note = user.notes.find(noteid) if !noteid.nil?
          if !note.nil?
              user.notes.find(noteid) 
              note.update_attributes!(params[:note])
          else
              note = user.notes.build(params[:note])
          note.save
          end
          render :json =&gt; {:result =&gt; note}
      else
          render :json =&gt; {:error =&gt; "nope"}
      end
    end
  </code></pre>
  
  <p>my routs file has the following</p>
  
  <pre><code>match '/note/update'  =&gt;  'myapi#update_note'
  </code></pre>
  
  <p>for you that are familiar with objective-c here is the code for making the request</p>
  
  <pre><code>NSDictionary *noteVo = [NSDictionary dictionaryWithObjectsAndKeys:note-&gt;title, @"title", note-&gt;body, @"body", note-&gt;note_id, @"note_id", nil];
  
      NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:[_dm getUser]-&gt;uuid, @"uuid", noteVo, @"note", true, @"remote", nil];
  
      NSError *writeError = nil;
  
      NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:NSJSONWritingPrettyPrinted error:&amp;writeError];
  
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:
                                      [NSURL URLWithString:[BASE_URL stringByAppendingString:@"note/update"]] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
      [request setHTTPMethod:@"POST"];
      [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
      [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
      [request setValue:[NSString stringWithFormat:@"%d", [jsonData length]] forHTTPHeaderField:@"Content-Length"];
      [request setHTTPBody: jsonData];
  
      [[NSURLConnection alloc] initWithRequest:request delegate:self];
  </code></pre>