Skip to content

Commit

Permalink
can now add things to the db through urls
Browse files Browse the repository at this point in the history
  • Loading branch information
dpick committed Oct 8, 2010
1 parent 6c0f2af commit dc56f4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
all[rand(all.size)].name
end

post '/adddrink' do
get '/adddrink/:drink/:ingredient/:amount/:unit' do
unit = Unit.first_or_create(:name => params[:unit])
ingredient = Ingredient.first_or_create(:name => params[:ingredient], :amount => params[:amount], :unit => unit)

Expand All @@ -38,6 +38,6 @@
drink.save
end

post '/addbeer' do
get '/addbeer/:beer' do
Beer.first_or_create(:name => params[:beer])
end
Binary file modified development.db
Binary file not shown.

0 comments on commit dc56f4c

Please sign in to comment.