Skip to content

Instantly share code, notes, and snippets.

@baileylo
Created October 15, 2010 07:51
Show Gist options
  • Select an option

  • Save baileylo/627798 to your computer and use it in GitHub Desktop.

Select an option

Save baileylo/627798 to your computer and use it in GitHub Desktop.
Make sure we're looking at board
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