File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Resource routing allows you to quickly declare all of the common routes for a gi
4949config/routes.rb <!-- .element: class="filename" -->
5050
5151``` ruby
52- Community :: Application .routes.draw do
52+ Rails .application .routes.draw do
5353 resources :posts
5454end
5555```
@@ -186,15 +186,15 @@ resources :posts, path: '/admin/posts'
186186app/models/user.rb <!-- .element: class="filename" -->
187187
188188``` ruby
189- class User < ActiveRecord :: Base
189+ class User < ApplicationRecord
190190 has_many :posts
191191end
192192```
193193
194194app/models/post.rb <!-- .element: class="filename" -->
195195
196196``` ruby
197- class Post < ActiveRecord :: Base
197+ class Post < ApplicationRecord
198198 belongs_to :user
199199end
200200```
@@ -468,13 +468,13 @@ class BlacklistConstraint
468468 end
469469end
470470
471- Community :: Application .routes.draw do
471+ Rails .application .routes.draw do
472472 get ' *path' , to: ' blacklist#index' , constraints: BlacklistConstraint .new
473473end
474474```
475475
476476``` ruby
477- Community :: Application .routes.draw do
477+ Rails .application .routes.draw do
478478 get ' *path' , to: ' blacklist#index' , constraints: lambda { |request | Blacklist .retrieve_ips.include?(request.remote_ip) }
479479end
480480```
You can’t perform that action at this time.
0 commit comments