adding sequel method that uses variables of multiple scopes
This commit is contained in:
parent
50a6d264f8
commit
754e021047
@ -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>
|
@ -1,4 +1,6 @@
|
||||
Passingdata::Application.routes.draw do
|
||||
get "novel/sequel"
|
||||
|
||||
get "novel/index"
|
||||
|
||||
# The priority is based upon order of creation:
|
||||
|
Loading…
Reference in New Issue
Block a user