Skip to content

Instantly share code, notes, and snippets.

@jsmestad
Created April 5, 2009 07:54
Show Gist options
  • Select an option

  • Save jsmestad/90401 to your computer and use it in GitHub Desktop.

Select an option

Save jsmestad/90401 to your computer and use it in GitHub Desktop.
before_filter :fetch_proper_params, :only => [:show]
def show
render
end
private
def fetch_proper_params
@course = Course.find(params[:course_id])
@video = permitted_to?(:browse, :videos) ? @course.videos.find(:first) : Video.find(params[:id])
add_crumb "Watching #{@video.title}", permitted_to?(:browse, :videos) ? video_path(@video) : course_video_path(@course, @video)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment