Created
October 15, 2010 07:51
-
-
Save baileylo/627798 to your computer and use it in GitHub Desktop.
Make sure we're looking at board
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ConversationsController < ApplicationController | |
| before_filter :load_board | |
| # GET /conversations | |
| # GET /conversations.xml | |
| def index | |
| @conversations = Conversation.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.xml { render :xml => @conversations } | |
| end | |
| end | |
| # CODE REMOVED FOR CLARITY SAKE | |
| private | |
| def load_board | |
| if Board.exists?(params[:board_id]) | |
| @board = Board.find(params[:board_id]); | |
| end | |
| unless @board | |
| redirect_to(boards_path, :notice =>"Please specify a valid board") | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment