Skip to content
Browse files

zomg pages

  • Loading branch information...
1 parent b921adb commit f288c1dab7f8d1ea850facfe454a625779f50728 @steveklabnik committed
View
3 app/assets/javascripts/page.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
View
3 app/assets/stylesheets/page.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the page controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
6 app/controllers/pages_controller.rb
@@ -0,0 +1,6 @@
+class PagesController < ApplicationController
+ def show
+ @id = params[:id]
+ @next_id = @id.to_i + 1
+ end
+end
View
2 app/helpers/page_helper.rb
@@ -0,0 +1,2 @@
+module PageHelper
+end
View
3 app/views/pages/show.html.erb
@@ -0,0 +1,3 @@
+<h1>Page <%= @id %></h1>
+
+<p>Here's a link: <%= link_to "next", "/pages/#@next_id" %></p>
View
2 config/routes.rb
@@ -1,4 +1,6 @@
TurbolinksTest::Application.routes.draw do
+ resources :pages, :only => :show
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
9 test/functional/page_controller_test.rb
@@ -0,0 +1,9 @@
+require 'test_helper'
+
+class PageControllerTest < ActionController::TestCase
+ test "should get show" do
+ get :show
+ assert_response :success
+ end
+
+end
View
4 test/unit/helpers/page_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PageHelperTest < ActionView::TestCase
+end

0 comments on commit f288c1d

Please sign in to comment.
Something went wrong with that request. Please try again.