Skip to main content
added 202 characters in body
Source Link
Sahil Grover
  • 1.9k
  • 4
  • 26
  • 58
  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.

Check this : http://railscasts.com/episodes/205-unobtrusive-javascript

try putting in your controller

respond_to do |format| format.html format.json { render :json=> {:success => true, :id => @contact.id } } end 

Something like this.

  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.

Check this : http://railscasts.com/episodes/205-unobtrusive-javascript

  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.

Check this : http://railscasts.com/episodes/205-unobtrusive-javascript

try putting in your controller

respond_to do |format| format.html format.json { render :json=> {:success => true, :id => @contact.id } } end 

Something like this.

added 72 characters in body
Source Link
Sahil Grover
  • 1.9k
  • 4
  • 26
  • 58
  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.

Check this : http://railscasts.com/episodes/205-unobtrusive-javascript

  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.
  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.

Check this : http://railscasts.com/episodes/205-unobtrusive-javascript

Post Undeleted by Sahil Grover
Post Deleted by Sahil Grover
Source Link
Sahil Grover
  • 1.9k
  • 4
  • 26
  • 58

  1. If you are doing a ajax request it should prefferably be JSON.
  2. For Json, check for a file named contacts.json.erb in contacts folder.
  3. You can try using remote true, much clean and better option than ajax/json requests.