filling in guts of Novel controller and associated template
This commit is contained in:
parent
e690886d6b
commit
50a6d264f8
@ -1,5 +1,17 @@
|
|||||||
class NovelController < ApplicationController
|
class NovelController < ApplicationController
|
||||||
def index
|
def index
|
||||||
|
@title = 'Shattered View: a Novel on Rails'
|
||||||
|
one_plus_one = 1 + 1
|
||||||
|
increment_counter one_plus_one
|
||||||
|
end
|
||||||
|
|
||||||
|
def helper_method
|
||||||
|
@help_message = "I see you've come to me for help."
|
||||||
|
end
|
||||||
|
|
||||||
|
def increment_counter(by)
|
||||||
|
@counter ||= 0
|
||||||
|
@counter += by
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,2 +1,6 @@
|
|||||||
<h1>Novel#index</h1>
|
<h1><%= @title %></h1>
|
||||||
<p>Find me in app/views/novel/index.html.erb</p>
|
|
||||||
|
<p>I looked up, but saw only the number <%= @counter %></p>
|
||||||
|
|
||||||
|
<p>“What are you doing here?” I asked sharply. “Was it
|
||||||
|
<%= @counter.succ %> who sent you?”</p>
|
||||||
|
@ -56,5 +56,5 @@ Passingdata::Application.routes.draw do
|
|||||||
|
|
||||||
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
||||||
# Note: This route will make all actions in every controller accessible via GET requests.
|
# Note: This route will make all actions in every controller accessible via GET requests.
|
||||||
# match ':controller(/:action(/:id(.:format)))'
|
match ':controller(/:action(/:id(.:format)))'
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user