Permalink
Browse files

put /categories.json

  • Loading branch information...
1 parent a328813 commit ec0d1909f4fcbe7954d0526390e13de84a0afc49 @winton committed Oct 27, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/a_b/controller/api.rb
View
@@ -44,6 +44,21 @@
end
end
+ put '/categories.json' do
+ content_type :json
+ @user = allow?
+ if @user
+ @category = @user.categories.find_by_id params[:category][:id]
+ if @category.update_attributes(params[:category])
+ @category.to_json
+ else
+ false.to_json
+ end
+ else
+ false.to_json
+ end
+ end
+
post '/envs.json' do
content_type :json
@user = allow?

0 comments on commit ec0d190

Please sign in to comment.