Skip to content

Instantly share code, notes, and snippets.

Roles Release 0.1
Basic forum posting ability (including validation)
User Reads Games
Topics
Posts
Users creates Game
Topic
Post
#routes.rb
new_game_topic_post GET /games/:game_id/topics/:topic_id/posts/new(.:format) {:action=>"new", :controller=>"posts"}
==========
#posts/show.html.erb
<%=h @topic.name %>
<table>
<tr>
<th width="60%">post Title</th>
<th width="10%">Replies</th>
Processing TopicsController#create (for 127.0.0.1 at 2009-10-02 19:06:08) [POST]
Parameters: {"commit"=>"Submit", "authenticity_token"=>"75fB/RVjaTLiUSshvwlaAdJ+m+2WujhVDRw/iC7kdEM=", "topic"=>{"last_post_at(1i)"=>"2009", "name"=>"3wfu8asdf", "last_post_at(2i)"=>"10", "last_post_at(3i)"=>"2", "last_post_at(4i)"=>"23", "last_post_at(5i)"=>"34", "game_id"=>"1"}}
Topic Create (15.0ms) INSERT INTO "topics" ("name", "last_post_at", "created_at", "updated_at", "game_id") VALUES('3wfu8asdf', '2009-10-02 23:34:00', '2009-10-03 00:06:09', '2009-10-03 00:06:09', NULL)
Processing TopicsController#create (for 127.0.0.1 at 2009-10-02 18:36:14) [POST]
Parameters: {"commit"=>"Submit", "authenticity_token"=>"75fB/RVjaTLiUSshvwlaAdJ+m+2WujhVDRw/iC7kdEM=", "topic"=>{"last_post_at(1i)"=>"2009", "name"=>"asdfasdf", "last_post_at(2i)"=>"10", "last_post_at(3i)"=>"2", "last_post_at(4i)"=>"23", "last_post_at(5i)"=>"34", "game_id"=>"1"}}
Topic Create (0.4ms) INSERT INTO "topics" ("name", "last_post_at", "created_at", "updated_at", "game_id") VALUES('asdfasdf', '2009-10-02 23:34:00', '2009-10-02 23:36:14', '2009-10-02 23:36:14', NULL)