You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,21 +13,25 @@ If the above fails (say, because `rerun` doesn't work on your system), try
13
13
14
14
rackup
15
15
16
-
Then open <http://localhost:9292> in a web browser.
16
+
Then open <http://localhost:9292> in a web browser, and verify that you can navigate the installfest slides.
17
17
18
-
If you make any changes, and especially before a pull request, run
18
+
If you expect to make any changes, run
19
19
20
-
rake spec
20
+
bundle exec rake spec
21
21
22
-
which will run some unit tests and also do syntax validation on all pages, to make sure you didn't break anything.
22
+
which will run the test suite to confirm that you are ready to (preliminarily) validate any changes you make.
23
23
24
-
When you submit a Pull Request, Travis CI will also run all the tests.
24
+
NOTE: Before submitting a pull request, you should make sure that you are on a feature branch, in sync with (rebased to) the current upstream master, and that you can cleanly run
25
+
26
+
bundle exec rake spec
27
+
28
+
which will run our standard unit tests and also do syntax validation on all pages, to make sure you didn't break anything. When you submit a Pull Request, Travis CI will also run all the tests.
25
29
26
30
# Overview
27
31
28
-
This is a Sinatra app, deployed at <http://docs.railsbridge.org>. The Railsbridge documentation project is home to a few subprojects, including the Railsbridge installfest instructions, which leads students through the various complicated setup instructions for getting Ruby, Rails, Git, etc. installed on their computer (whatever combination of computer, OS, and version they happened to bring the the workshop!), as well as the Railsbridge workshop "Suggestotron" curriculum.
32
+
This is a Sinatra app, deployed at <http://docs.railsbridge.org>. The RailsBridge documentation project is home to a few subprojects, including the RailsBridge installfest instructions, which leads students through the various complicated setup instructions for getting Ruby, Rails, Git, etc. installed on their computer (whatever combination of computer, OS, and version they happened to bring to the workshop!), as well as the RailsBridge workshop "Suggestotron" curriculum.
29
33
30
-
Each subproject (a "site") comprises files stored under the "sites" directory; for instance, the installfest instructions are located at ROOT/sites/installfest, while the curriculum can be found under ROOT/sites/curriculum.
34
+
Each subproject (a "site") comprises files stored under the "sites" directory; for instance, the installfest instructions are located at ROOT/sites/installfest, while the standard curriculum can be found under ROOT/sites/curriculum.
31
35
32
36
These files can be in any of these formats:
33
37
@@ -46,9 +50,9 @@ StepFile is a new, Ruby-based DSL for describing complex, nested instructions in
46
50
47
51
[Deck.rb](https://github.com/alexch/deck.rb) converts Markdown files into an interactive in-browser HTML+JavaScript slide deck.
Slide contents that change with each workshop are contained in three files under the workshop project. The 'hello and welcome, this is when the breaks are' presentation slides are in current.deck.md. The 'this is what we will learn today' slides are in welcome.deck.md. And the 'this is what we have learned' slides are in closing.deck.md.
55
+
Slide contents that change with each workshop are contained in three files under the workshop project. The 'hello and welcome, this is when the breaks are' presentation slides are in current.deck.md. The 'this is what we will learn today' slides are in welcome.deck.md. And the 'this is what we have learned, and what comes next' slides are in closing.deck.md.
52
56
53
57
To change those contents, clone this repo, make changes, and then to include your changes in the publicly available repo, send a pull request.
54
58
@@ -222,6 +226,7 @@ StepFile is an [Erector](http://erector.rubyforge.org)-based DSL, so if you want
222
226
* move fonts local
223
227
224
228
# TODO (content)
229
+
* pull "organizer" content (from this readme.md) and point to the real stuff they should use
Copy file name to clipboardExpand all lines: lib/step.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ def consider_deploying
89
89
div:class=>"deploying"do
90
90
h1"Deploying"
91
91
blockquotedo
92
-
message"Before the next step, you could try deploying your app to Heroku! Note, that until you reach the stage 'Setting The Default Page', Heroku may tell you 'The page you were looking for doesn't exist'."
92
+
message"Before the next step, you could try deploying your app to Heroku!"
Copy file name to clipboardExpand all lines: sites/curriculum/setting_the_default_page.step
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -13,20 +13,16 @@ goals {
13
13
steps {
14
14
15
15
step "Add a root route" do
16
-
message "Open `config/routes.rb`. Near the end of the file but before the final end add `root :to => 'topics#index'`. When you are done the last few lines should look like this:"
16
+
message "Open `config/routes.rb`. Search the file for 'root' (near the top) uncomment that line and change it to read `root 'topics#index'`. When you are done the line should look like this:"
17
17
18
-
source_code :ruby, <<-RUBY
19
-
root :to => 'topics#index'
20
-
RUBY
21
-
end
18
+
message "(Rails 3.x users should add `root to: 'topics#index'` and will need to remove their `public/index.html` file)."
22
19
23
-
step "Remove the static welcome file" do
24
-
25
-
message " You also need to remove the welcome aboard page for the new route to work."
20
+
end
26
21
27
-
console "git rm public/index.html"
22
+
source_code :ruby, <<-RUBY
23
+
root 'topics#index'
24
+
RUBY
28
25
29
-
end
30
26
31
27
step "Confirm your changes" do
32
28
message "Go back to <http://localhost:3000/>. You should be taken to the topics list automatically."
@@ -36,7 +32,7 @@ root :to => 'topics#index'
36
32
explanation {
37
33
38
34
message <<-MARKDOWN
39
-
* `root :to => 'topics#index'` is a rails route that says the default
35
+
* `root 'topics#index'` is a rails route that says the default
40
36
address for your site is `topics#index`. `topics#index` is the topics
41
37
list page (the topics controller with the index action).
42
38
* Rails routes control how URLs (web addresses) get matched with
@@ -54,24 +50,25 @@ explanation {
54
50
````
55
51
$ rake routes
56
52
57
-
votes GET /votes(.:format) votes#index
58
-
POST /votes(.:format) votes#create
59
-
new_vote GET /votes/new(.:format) votes#new
60
-
edit_vote GET /votes/:id/edit(.:format) votes#edit
61
-
vote GET /votes/:id(.:format) votes#show
62
-
PUT /votes/:id(.:format) votes#update
63
-
DELETE /votes/:id(.:format) votes#destroy
53
+
Prefix Verb URI Pattern Controller#Action
64
54
topics GET /topics(.:format) topics#index
65
55
POST /topics(.:format) topics#create
66
56
new_topic GET /topics/new(.:format) topics#new
67
57
edit_topic GET /topics/:id/edit(.:format) topics#edit
68
58
topic GET /topics/:id(.:format) topics#show
59
+
PATCH /topics/:id(.:format) topics#update
69
60
PUT /topics/:id(.:format) topics#update
70
61
DELETE /topics/:id(.:format) topics#destroy
71
-
root / topics#index
62
+
root GET / topics#index
72
63
````
73
64
This shows all the URLs your application responds to. The code that starts with colons are variables so :id means the id number of the record. The code in parenthesis is optional.
74
65
66
+
In Rails 4, you can also get this information on your site in development. Go to <a href="http://localhost:3000/rails/info">http://localhost:3000/rails/info</a> and you'll see something like this:
67
+
68
+
<img src='img/rails4_rails_info_routing.png'>
69
+
70
+
You'll also see that table in Rails 4 whenever you try to access an invalid route (try <a href="http://localhost:3000/sandwich">http://localhost:3000/sandwich</a>)
71
+
75
72
### Exploring Routes (optional)
76
73
77
74
Now you can have a look at the paths that are available in your app.
0 commit comments