Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix GH #5353. Misleading code examples inside the auto-generated rail…

…s README file
  • Loading branch information...
commit fff04f67a091899356b9a6c8dbe3074e8ae561cf 1 parent ee0879f
@kennyj authored
View
10 actionpack/README.rdoc
@@ -33,7 +33,7 @@ A short rundown of some of the major features:
* Actions grouped in controller as methods instead of separate command objects
and can therefore share helper methods
- class CustomersController < ActionController::Base
+ class CustomersController < ApplicationController
def show
@customer = find_customer
end
@@ -98,7 +98,7 @@ A short rundown of some of the major features:
* Filters for pre- and post-processing of the response
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
# filters as methods
before_filter :authenticate, :cache, :audit
@@ -137,7 +137,7 @@ A short rundown of some of the major features:
* Layout sharing for template reuse
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
layout "weblog_layout"
def hello_world
@@ -212,7 +212,7 @@ A short rundown of some of the major features:
* Caching at three levels of granularity (page, action, fragment)
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
caches_page :show
caches_action :account
@@ -257,7 +257,7 @@ methods:
require 'action_controller'
require 'post'
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
layout "weblog/layout"
def index
View
12 actionpack/lib/abstract_controller/layouts.rb
@@ -65,7 +65,7 @@ module AbstractController
#
# == Inheritance Examples
#
- # class BankController < ActionController::Base
+ # class BankController < ApplicationController
# # bank.html.erb exists
#
# class ExchangeController < BankController
@@ -109,7 +109,7 @@ module AbstractController
#
# The method reference is the preferred approach to variable layouts and is used like this:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# layout :writers_and_readers
#
# def index
@@ -126,13 +126,13 @@ module AbstractController
#
# If you want to use an inline method, such as a proc, do something like this:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# layout proc{ |controller| controller.logged_in? ? "writer_layout" : "reader_layout" }
# end
#
# Of course, the most common way of specifying a layout is still just as a plain template name:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# layout "weblog_standard"
# end
#
@@ -161,7 +161,7 @@ module AbstractController
# a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The
# <tt>:only</tt> and <tt>:except</tt> options can be passed to the layout call. For example:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# layout "weblog_standard", :except => :rss
#
# # ...
@@ -180,7 +180,7 @@ module AbstractController
# Sometimes you'll have exceptions where one action wants to use a different layout than the rest of the controller.
# You can do this by passing a <tt>:layout</tt> option to the <tt>render</tt> call. For example:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# layout "weblog_standard"
#
# def help
View
4 actionpack/lib/action_controller/caching/pages.rb
@@ -12,7 +12,7 @@ module Caching
#
# Specifying which actions to cache is done through the <tt>caches_page</tt> class method:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# caches_page :show, :new
# end
#
@@ -24,7 +24,7 @@ module Caching
# Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache
# is not restored before another hit is made against it. The API for doing so mimics the options from +url_for+ and friends:
#
- # class WeblogController < ActionController::Base
+ # class WeblogController < ApplicationController
# def update
# List.update(params[:list][:id], params[:list])
# expire_page :action => "show", :id => params[:list][:id]
View
4 railties/guides/code/getting_started/README.rdoc
@@ -57,7 +57,7 @@ shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
@@ -89,7 +89,7 @@ execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install ruby-debug19 to run the server in debugging
mode. With gems, use <tt>sudo gem install ruby-debug19</tt>. Example:
- class WeblogController < ActionController::Base
+ class WeblogController < ApplicationController
def index
@posts = Post.all
debugger
Please sign in to comment.
Something went wrong with that request. Please try again.