adding sequel method that uses variables of multiple scopes
This commit is contained in:
@@ -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
|
||||
|
@@ -0,0 +1,2 @@
|
||||
<p>Here they come, the counting numbers,
|
||||
<%= $one %>, <%= $two %>, <%= $three %>.</p>
|
Reference in New Issue
Block a user