adding sequel method that uses variables of multiple scopes

This commit is contained in:
Dan Buch 2011-08-09 06:14:03 -04:00
parent 50a6d264f8
commit 754e021047
3 changed files with 12 additions and 0 deletions

View File

@ -1,4 +1,8 @@
$one = 1
class NovelController < ApplicationController
$two = 2
def index
@title = 'Shattered View: a Novel on Rails'
one_plus_one = 1 + 1
@ -14,4 +18,8 @@ class NovelController < ApplicationController
@counter += by
end
def sequel
$three = 3
end
end

View File

@ -0,0 +1,2 @@
<p>Here they come, the counting numbers,
<%= $one %>, <%= $two %>, <%= $three %>.</p>

View File

@ -1,4 +1,6 @@
Passingdata::Application.routes.draw do
get "novel/sequel"
get "novel/index"
# The priority is based upon order of creation: