Permalink
Browse files

Added pages controller

  • Loading branch information...
1 parent f9f45c0 commit 8ac4c6d6e35c977c2c0e5190d0726f60d88abcdf @Matt-Field committed May 19, 2011
View
3 .idea/misc.xml
@@ -3,6 +3,9 @@
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
+ <component name="ProjectResources">
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
+ </component>
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.2-p180" project-jdk-type="RUBY_SDK" />
</project>
View
5 .idea/sample_app.iml
@@ -72,6 +72,11 @@
<orderEntry type="library" scope="PROVIDED" name="[gem] activerecord (v3.0.7, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.7)" level="application" />
<orderEntry type="library" scope="PROVIDED" name="[gem] actionmailer (v3.0.7, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/actionmailer-3.0.7)" level="application" />
<orderEntry type="library" scope="PROVIDED" name="[gem] sqlite3-ruby (v1.3.2, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-ruby-1.3.2)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] sqlite3 (v1.3.3, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/sqlite3-1.3.3)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] webrat (v0.7.1, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/webrat-0.7.1)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] rspec-rails (v2.5.0, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/rspec-rails-2.5.0)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] rspec (v2.5.0, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/rspec-2.5.0)" level="application" />
+ <orderEntry type="library" scope="PROVIDED" name="[gem] nokogiri (v1.4.4, /Users/Matthew/.rvm/gems/ruby-1.9.2-p180/gems/nokogiri-1.4.4)" level="application" />
</component>
</module>
View
168 .idea/workspace.xml
@@ -24,10 +24,28 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="Gemfile" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/Gemfile">
+ <file leaf-file-name="routes.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="71" selection-start="279" selection-end="279" vertical-scroll-proportion="0.4892704">
+ <state line="25" column="44" selection-start="747" selection-end="747" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="pages_controller.rb" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/app/controllers/pages_controller.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="7" column="41" selection-start="88" selection-end="88" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="home.html.erb" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/app/views/pages/home.html.erb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -39,6 +57,7 @@
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/Gemfile" />
+ <option value="$PROJECT_DIR$/public/index.html" />
</list>
</option>
</component>
@@ -68,9 +87,6 @@
<sortByType />
</navigator>
<panes>
- <pane id="Scope" />
- <pane id="Favorites" />
- <pane id="RailsProjectView" />
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -79,8 +95,107 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="public" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="views" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="pages" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="views" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="sample_app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="app" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="controllers" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
</subPane>
</pane>
+ <pane id="Scope" />
+ <pane id="Favorites" />
+ <pane id="RailsProjectView" />
</panes>
</component>
<component name="PropertiesComponent">
@@ -249,6 +364,7 @@
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
+ <changelist id="994d902e-e4af-4192-a841-204011ea2f6d" name="Default" comment="" />
<created>1305816434088</created>
<updated>1305816434088</updated>
</task>
@@ -258,22 +374,22 @@
<frame x="287" y="84" width="1199" height="871" extended-state="0" />
<editor active="true" />
<layout>
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32991013" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
- <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24936171" sideWeight="0.67008984" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32991013" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+ <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsManagerConfiguration">
@@ -311,7 +427,33 @@
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="71" selection-start="279" selection-end="279" vertical-scroll-proportion="0.4892704">
+ <state line="19" column="71" selection-start="279" selection-end="279" vertical-scroll-proportion="0.304" />
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/public/index.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="239" column="0" selection-start="5780" selection-end="5780" vertical-scroll-proportion="0.98463684">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/config/routes.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="25" column="44" selection-start="747" selection-end="747" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/app/controllers/pages_controller.rb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="7" column="41" selection-start="88" selection-end="88" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/app/views/pages/home.html.erb">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
View
5 README.markup
@@ -0,0 +1,5 @@
+# Ruby on Rails Tutorial: sample application
+
+This is the sample application for
+[*Ruby on Rails Tutorial: Learn Rails by Example*](http://railstutorial.org/)
+by [Michael Hartl](http://michaelhartl.com/).
View
8 app/controllers/pages_controller.rb
@@ -0,0 +1,8 @@
+class PagesController < ApplicationController
+ def home
+ end
+
+ def contact
+ end
+
+end
View
2 app/helpers/pages_helper.rb
@@ -0,0 +1,2 @@
+module PagesHelper
+end
View
2 app/views/pages/contact.html.erb
@@ -0,0 +1,2 @@
+<h1>Pages#contact</h1>
+<p>Find me in app/views/pages/contact.html.erb</p>
View
2 app/views/pages/home.html.erb
@@ -0,0 +1,2 @@
+<h1>Pages#home</h1>
+<p>Find me in app/views/pages/home.html.erb</p>
View
4 config/routes.rb
@@ -1,4 +1,8 @@
SampleApp::Application.routes.draw do
+ get "pages/home"
+
+ get "pages/contact"
+
# The priority is based upon order of creation:
# first created -> highest priority.
View
19 spec/controllers/pages_controller_spec.rb
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe PagesController do
+
+ describe "GET 'home'" do
+ it "should be successful" do
+ get 'home'
+ response.should be_success
+ end
+ end
+
+ describe "GET 'contact'" do
+ it "should be successful" do
+ get 'contact'
+ response.should be_success
+ end
+ end
+
+end
View
15 spec/helpers/pages_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the PagesHelper. For example:
+#
+# describe PagesHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# helper.concat_strings("this","that").should == "this that"
+# end
+# end
+# end
+describe PagesHelper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
View
5 spec/views/pages/contact.html.erb_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe "pages/contact.html.erb" do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
View
5 spec/views/pages/home.html.erb_spec.rb
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe "pages/home.html.erb" do
+ pending "add some examples to (or delete) #{__FILE__}"
+end

0 comments on commit 8ac4c6d

Please sign in to comment.