Created
September 14, 2011 12:24
-
-
Save alterisian/1216430 to your computer and use it in GitHub Desktop.
So that we can watch a random railscast.
This file contains 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 WatchController < ApplicationController | |
def index | |
max_cast = 222 #todo-fetchMaxCastNumber | |
base_url = "http://railscasts.com/episodes/" | |
options = "?autoplay=true" | |
random_cast = Random.rand(max_cast) | |
redirect_to base_url + random_cast.to_s + options | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment