filling in guts of Novel controller and associated template

cat-town
Dan Buch 13 years ago
parent e690886d6b
commit 50a6d264f8

@ -1,5 +1,17 @@
class NovelController < ApplicationController
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

@ -1,2 +1,6 @@
<h1>Novel#index</h1>
<p>Find me in app/views/novel/index.html.erb</p>
<h1><%= @title %></h1>
<p>I looked up, but saw only the number <%= @counter %></p>
<p>&ldquo;What are you doing here?&rdquo; I asked sharply. &ldquo;Was it
<%= @counter.succ %> who sent you?&rdquo;</p>

@ -56,5 +56,5 @@ Passingdata::Application.routes.draw do
# 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.
# match ':controller(/:action(/:id(.:format)))'
match ':controller(/:action(/:id(.:format)))'
end

Loading…
Cancel
Save