Skip to content

Instantly share code, notes, and snippets.

View nettofarah's full-sized avatar

Netto Farah nettofarah

View GitHub Profile
class Chef < ActiveRecord::Base
has_many :recipes
has_many :ingredients, through: :recipes
end
class Recipe < ActiveRecord::Base
has_many :recipes_ingredients
has_many :ingredients, through: :recipes_ingredients
end
@nettofarah
nettofarah / unfollow.xml
Created May 6, 2013 18:01
unfollow.xml
<response>
<logged-in>true</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<user>
<id>1</id>
<followed-by-current-user>false</followed-by-current-user>
</user>
</response>
curl -u remi:good --request POST -d '' http://8tracks.com/users/1/unfollow.xml
<response>
<logged-in>true</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<user>
<id>1</id>
<followed-by-current-user>true</followed-by-current-user>
</user>
</response>
curl -u remi:good --request POST -d '' http://8tracks.com/users/1/follow.xml
@nettofarah
nettofarah / toggle_follow.xml
Created May 6, 2013 18:00
toggle_follow.xml
<response>
<logged-in>true</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<user>
<id>1</id>
<followed-by-current-user>true</followed-by-current-user>
</user>
</response>
@nettofarah
nettofarah / toggle_follow.sh
Created May 6, 2013 17:59
toggle_follow.sh
curl -u remi:good --request POST -d '' http://8tracks.com/users/1/toggle_follow.xml
<response>
<logged-in>true</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<track>
<id>23</id>
<faved-by-current-user>false</faved-by-current-user>
</track>
</response>
curl -u remi:good --request POST -d '' http://8tracks.com/tracks/23/unfav.xml
<response>
<logged-in>true</logged-in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
<track>
<id>23</id>
<faved-by-current-user>true</faved-by-current-user>
</track>
</response>