diff --git a/cookbook/015/02/passingdata/app/controllers/novel_controller.rb b/cookbook/015/02/passingdata/app/controllers/novel_controller.rb index 47409de..6ead1d8 100644 --- a/cookbook/015/02/passingdata/app/controllers/novel_controller.rb +++ b/cookbook/015/02/passingdata/app/controllers/novel_controller.rb @@ -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 diff --git a/cookbook/015/02/passingdata/app/views/novel/sequel.html.erb b/cookbook/015/02/passingdata/app/views/novel/sequel.html.erb new file mode 100644 index 0000000..fd320c7 --- /dev/null +++ b/cookbook/015/02/passingdata/app/views/novel/sequel.html.erb @@ -0,0 +1,2 @@ +

Here they come, the counting numbers, +<%= $one %>, <%= $two %>, <%= $three %>.

diff --git a/cookbook/015/02/passingdata/config/routes.rb b/cookbook/015/02/passingdata/config/routes.rb index 4e2bc41..4b1aa65 100644 --- a/cookbook/015/02/passingdata/config/routes.rb +++ b/cookbook/015/02/passingdata/config/routes.rb @@ -1,4 +1,6 @@ Passingdata::Application.routes.draw do + get "novel/sequel" + get "novel/index" # The priority is based upon order of creation: