search for: boards_url

Displaying 1 result from an estimated 1 matches for "boards_url".

2011 Nov 24
4
How do I destroy all the posts when the board is destroyed?
...s belong to a board I try to destroy all the posts under a board when I destroy the board. My destroy function is following. def destroy @board = Board.find(params[:id]) @post = @board.posts @post.destroy @board.destroy respond_to do |format| format.html { redirect_to(boards_url) } format.xml { head :ok } end end However, it does not work. Could anyone tell me how to destroy all the posts when the board is destroyed? My source code is following. http://dl.dropbox.com/u/40209252/forum_demo.tar.gz -- You received this message because you are subscribed to th...