Skip to content

Commit a6ef533

Browse files
committed
Merge branch 'master' of github.com:railsbridge/docs
2 parents 86c5973 + 483d829 commit a6ef533

31 files changed

+312
-113
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,25 @@ If the above fails (say, because `rerun` doesn't work on your system), try
1313

1414
rackup
1515

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.
1717

18-
If you make any changes, and especially before a pull request, run
18+
If you expect to make any changes, run
1919

20-
rake spec
20+
bundle exec rake spec
2121

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.
2323

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.
2529

2630
# Overview
2731

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.
2933

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.
3135

3236
These files can be in any of these formats:
3337

@@ -46,9 +50,9 @@ StepFile is a new, Ruby-based DSL for describing complex, nested instructions in
4650

4751
[Deck.rb](https://github.com/alexch/deck.rb) converts Markdown files into an interactive in-browser HTML+JavaScript slide deck.
4852

49-
#Organizer Instructions
53+
#Organizer Instructions (probably outdated -- double check)
5054

51-
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.
5256

5357
To change those contents, clone this repo, make changes, and then to include your changes in the publicly available repo, send a pull request.
5458

@@ -222,6 +226,7 @@ StepFile is an [Erector](http://erector.rubyforge.org)-based DSL, so if you want
222226
* move fonts local
223227

224228
# TODO (content)
229+
* pull "organizer" content (from this readme.md) and point to the real stuff they should use
225230
* install ALL the operating systems!
226231
* troubleshooting page
227232
* look into installation scripts

lib/step.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def consider_deploying
8989
div :class => "deploying" do
9090
h1 "Deploying"
9191
blockquote do
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!"
9393
link 'deploying_to_heroku'
9494
end
9595
end

sites/curriculum/CRUD_with_scaffolding.step

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,4 @@ explanation {
104104
MARKDOWN
105105
}
106106

107-
consider_deploying
108-
109-
next_step "voting_on_topics"
107+
next_step "setting_the_default_page"

sites/curriculum/allow_people_to_vote.step

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ explanation {
7171

7272
consider_deploying
7373

74-
next_step "setting_the_default_page"
74+
next_step "redirect_to_the_topics_list_after_creating_a_new_topic"

sites/curriculum/curriculum.step

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ day... unless I really screwed something up. :D
3838

3939
We're going to be working with:
4040

41-
* ruby 1.9.3 installed via rvm (mac or linux) or RailsInstaller (windows)
42-
* rails 3.2.x
41+
* ruby 1.9.3 installed via rvm (mac or linux) or RailsInstaller (mac or windows)
42+
* rails 3.2.x or rails 4.0.x
4343
* bundler
4444
* sqlite
4545
* the text editor of your choice

sites/curriculum/deploying_to_heroku.step

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ gem 'sqlite3'
2727
message "**Remove that line** and replace it with:"
2828

2929
source_code :ruby, <<-RUBY
30-
group :development do
30+
group :development, :test do
3131
gem 'sqlite3'
3232
end
3333

3434
group :production do
3535
gem 'pg'
36+
gem 'rails_12factor'
3637
end
3738
RUBY
3839
end

sites/curriculum/hooking_up_votes_and_topics.step

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ steps {
2323

2424
source_code :ruby, <<-RUBY
2525
class Topic < ActiveRecord::Base
26-
attr_accessible :description, :title
2726
has_many :votes, dependent: :destroy
2827
end
2928
RUBY
@@ -33,7 +32,6 @@ end
3332
message "Edit `app/models/vote.rb` so that it looks like this:"
3433
source_code :ruby, <<-RUBY
3534
class Vote < ActiveRecord::Base
36-
attr_accessible :topic_id
3735
belongs_to :topic
3836
end
3937
RUBY
37.9 KB
Loading

sites/curriculum/running_your_application_locally.step

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,4 @@ explanation do
3030
message "Control+C is a way of closing or cancelling terminal programs. Since rails server runs forever, you need to interrupt it with Control+C."
3131
end
3232

33-
consider_deploying
34-
3533
next_step "creating_a_migration"

sites/curriculum/setting_the_default_page.step

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ goals {
1313
steps {
1414

1515
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:"
1717

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)."
2219

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
2621

27-
console "git rm public/index.html"
22+
source_code :ruby, <<-RUBY
23+
root 'topics#index'
24+
RUBY
2825

29-
end
3026

3127
step "Confirm your changes" do
3228
message "Go back to <http://localhost:3000/>. You should be taken to the topics list automatically."
@@ -36,7 +32,7 @@ root :to => 'topics#index'
3632
explanation {
3733

3834
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
4036
address for your site is `topics#index`. `topics#index` is the topics
4137
list page (the topics controller with the index action).
4238
* Rails routes control how URLs (web addresses) get matched with
@@ -54,24 +50,25 @@ explanation {
5450
````
5551
$ rake routes
5652

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
6454
topics GET /topics(.:format) topics#index
6555
POST /topics(.:format) topics#create
6656
new_topic GET /topics/new(.:format) topics#new
6757
edit_topic GET /topics/:id/edit(.:format) topics#edit
6858
topic GET /topics/:id(.:format) topics#show
59+
PATCH /topics/:id(.:format) topics#update
6960
PUT /topics/:id(.:format) topics#update
7061
DELETE /topics/:id(.:format) topics#destroy
71-
root / topics#index
62+
root GET / topics#index
7263
````
7364
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.
7465

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+
7572
### Exploring Routes (optional)
7673

7774
Now you can have a look at the paths that are available in your app.
@@ -92,4 +89,6 @@ explanation {
9289
MARKDOWN
9390
}
9491

95-
next_step "redirect_to_the_topics_list_after_creating_a_new_topic"
92+
consider_deploying
93+
94+
next_step "voting_on_topics"

0 commit comments

Comments
 (0)