Skip to content

Instantly share code, notes, and snippets.

@ascruggs
Created June 4, 2013 01:39
Show Gist options
  • Save ascruggs/5702974 to your computer and use it in GitHub Desktop.
Save ascruggs/5702974 to your computer and use it in GitHub Desktop.
desc 'add achievement to user'
params do
requires :id, type: String, desc: "Status ID."
requires :achievement_id, type: String, desc: "Achievement id you want to add"
end
put ':id' do
user = User.find params[:id]
achievement = Achievement.find params[:achievement_id]
user.achievements << achievement
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment