Skip to content

Commit

Permalink
games cannot be destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
joahking committed Jan 15, 2012
1 parent 2df438b commit aa51dc6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 22 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
== Pink pong

Rails application to record the results of the ping pong (pink pong) at "3scale headquarters":http://www.3scale.net
Rails application to record the results of the [ping pong matches](http://pinkpong.3scale.net) at [3scale headquarters](http://www.3scale.net)

=== TODO

* define a destroy strategy
* CSS love
* heroku deploy
* no email outside 3scale (user validation)?
12 changes: 0 additions & 12 deletions app/controllers/games_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,6 @@ def update
end
end

# DELETE /games/1
# DELETE /games/1.json
def destroy
@game = Game.find(params[:id])
@game.destroy

respond_to do |format|
format.html { redirect_to games_url }
format.json { head :ok }
end
end

protected

def load_users
Expand Down
1 change: 0 additions & 1 deletion app/views/games/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<td><%= game.loser.email %> <% if game.double? %> and <%= game.loser_double.email %><% end%></td>
<td><%= link_to 'Show', game %></td>
<td><%= link_to 'Edit', edit_game_path(game) %></td>
<td><%= link_to 'Destroy', game, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Pinkpong::Application.routes.draw do
resources :games
resources :games, :except => :destroy

devise_for :users

Expand Down
7 changes: 0 additions & 7 deletions test/functional/games_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,4 @@ class GamesControllerTest < ActionController::TestCase
assert_redirected_to game_path(assigns(:game))
end

test "should destroy game" do
sign_in @user
assert_difference('Game.count', -1) do
delete :destroy, :id => @game.to_param
end
assert_redirected_to games_path
end
end

0 comments on commit aa51dc6

Please sign in to comment.