Skip to content

Instantly share code, notes, and snippets.

@jsmestad
Created April 5, 2009 04:58
Show Gist options
  • Select an option

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

Select an option

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