Skip to content

Commit d29b532

Browse files
committed
Suggestotron Rails 5 changes
* Different startup page * ActiveRecord::Base -> ApplicationRecord * Routes file removed commented root route * Puma stop looks different than webrick stop
1 parent 5ac672a commit d29b532

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

sites/en/intro-to-rails/hooking_up_votes_and_topics.step

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ steps {
2222
message "Edit `app/models/topic.rb` so that it looks like this:"
2323

2424
source_code :ruby, <<-RUBY
25-
class Topic < ActiveRecord::Base
25+
class Topic < ApplicationRecord
2626
has_many :votes, dependent: :destroy
2727
end
2828
RUBY
@@ -31,7 +31,7 @@ end
3131
step "Teach the Vote model about Topics" do
3232
message "Edit `app/models/vote.rb` so that it looks like this:"
3333
source_code :ruby, <<-RUBY
34-
class Vote < ActiveRecord::Base
34+
class Vote < ApplicationRecord
3535
belongs_to :topic
3636
end
3737
RUBY
43.7 KB
Loading

sites/en/intro-to-rails/running_your_application_locally.step

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ will be ignored."
2323
message "To get back to the terminal, you can stop the server by typing
2424
`Control-c`."
2525
result <<-STOPPING_RAILS_SERVER
26-
^C[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] INFO going to shutdown ...
27-
[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] INFO WEBrick::HTTPServer#start done.
28-
Exiting
26+
^CExiting
2927
STOPPING_RAILS_SERVER
3028
end
3129
end

sites/en/intro-to-rails/setting_the_default_page.step

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ steps {
1818

1919
message "Search the file for **root**, it should be near the top if you are using Rails 4. You can use Sublime Text's search: look for **Find...** in the **Find** menu."
2020

21-
message "Uncomment the line that contains the example command by removing the `#` sign in front of it, and change it to read `root 'topics#index'`. When you are done the line should look like this:"
21+
message "Look for the line `Rails.application.routes.draw` at the beginning of the file, and add the line `root 'topics#index'` after it. When you are done the start of the file should look like this:"
2222

2323
source_code :ruby, <<-RUBY
24-
root 'topics#index'
24+
Rails.application.routes.draw do
25+
root 'topics#index'
2526
RUBY
2627

2728
em do
@@ -68,11 +69,11 @@ explanation {
6869
````
6970
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.
7071

71-
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:
72+
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:
7273

7374
<img src='img/rails4_rails_info_routing.png' alt='Screenshot of browser-based Rails routing info page'>
7475

75-
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>)
76+
You'll also see that table in whenever you try to access an invalid route (try <a href="http://localhost:3000/sandwich">http://localhost:3000/sandwich</a>)
7677

7778
### Exploring Routes (optional)
7879

sites/en/job-board/store_jobs_in_the_database.step

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ MARKDOWN
7777
message <<-MARKDOWN
7878
# Check out the model
7979

80-
The migration we just ran updated the database, but that doesn't mean that we can talk to the database using Ruby yet. Look at the file `app/models/job.rb`. The `Job` class inherits from ActiveRecord::Base, so that we can talk to the database with Ruby instead of SQL!
80+
The migration we just ran updated the database, but that doesn't mean that we can talk to the database using Ruby yet. Look at the file `app/models/job.rb`. The `Job` class inherits from ApplicationRecord, so that we can talk to the database with Ruby instead of SQL!
8181

8282
Okay, so we've got some place to store our jobs. But how can we make any? THROUGH THE MAGIC OF FORMS!!!
8383
MARKDOWN

0 commit comments

Comments
 (0)