aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-05-15 15:34:36 -0400
committerPrem Sichanugrist <s@sikachu.com>2012-03-13 14:55:44 -0400
commitf1637bf2bb00490203503fbd943b73406e043d1d (patch)
tree53bfe16edac03871486be9be4160ff8aa0e28216 /railties/guides/source
parenta85714a673d2e06b923bd4eba443a3849d332cce (diff)
downloadrails-f1637bf2bb00490203503fbd943b73406e043d1d.tar.gz
rails-f1637bf2bb00490203503fbd943b73406e043d1d.tar.bz2
rails-f1637bf2bb00490203503fbd943b73406e043d1d.zip
Remove Active Resource source files from the repository
Dear Active Resource, It's not that I hate you or anything, but you didn't get much attention lately. There're so many alternatives out there, and I think people have made their choice to use them than you. I think it's time for you to have a big rest, peacefully in this Git repository. I will miss you, @sikachu.
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/active_resource_basics.textile120
-rw-r--r--railties/guides/source/command_line.textile1
-rw-r--r--railties/guides/source/configuring.textile8
-rw-r--r--railties/guides/source/getting_started.textile7
-rw-r--r--railties/guides/source/initialization.textile2
5 files changed, 0 insertions, 138 deletions
diff --git a/railties/guides/source/active_resource_basics.textile b/railties/guides/source/active_resource_basics.textile
deleted file mode 100644
index 37abb8a640..0000000000
--- a/railties/guides/source/active_resource_basics.textile
+++ /dev/null
@@ -1,120 +0,0 @@
-h2. Active Resource Basics
-
-This guide should provide you with all you need to get started managing the connection between business objects and RESTful web services. It implements a way to map web-based resources to local objects with CRUD semantics.
-
-endprologue.
-
-WARNING. This Guide is based on Rails 3.0. Some of the code shown here will not work in earlier versions of Rails.
-
-h3. Introduction
-
-Active Resource allows you to connect with RESTful web services. So, in Rails, Resource classes inherited from +ActiveResource::Base+ and live in +app/models+.
-
-h3. Configuration and Usage
-
-Putting Active Resource to use is very similar to Active Record. It's as simple as creating a model class
-that inherits from ActiveResource::Base and providing a <tt>site</tt> class variable to it:
-
-<ruby>
-class Person < ActiveResource::Base
- self.site = "http://api.people.com:3000/"
-end
-</ruby>
-
-Now the Person class is REST enabled and can invoke REST services very similarly to how Active Record invokes
-life cycle methods that operate against a persistent store.
-
-h3. Reading and Writing Data
-
-Active Resource make request over HTTP using a standard JSON format. It mirrors the RESTful routing built into Action Controller but will also work with any other REST service that properly implements the protocol.
-
-h4. Read
-
-Read requests use the GET method and expect the JSON form of whatever resource/resources is/are being requested.
-
-<ruby>
-# Find a person with id = 1
-person = Person.find(1)
-# Check if a person exists with id = 1
-Person.exists?(1) # => true
-# Get all resources of Person class
-Person.all
-</ruby>
-
-h4. Create
-
-Creating a new resource submits the JSON form of the resource as the body of the request with HTTP POST method and parse the response into Active Resource object.
-
-<ruby>
-person = Person.create(:name => 'Vishnu')
-person.id # => 1
-</ruby>
-
-h4. Update
-
-To update an existing resource, 'save' method is used. This method make a HTTP PUT request in JSON format.
-
-<ruby>
-person = Person.find(1)
-person.name = 'Atrai'
-person.save
-</ruby>
-
-h4. Delete
-
-'destroy' method makes a HTTP DELETE request for an existing resource in JSON format to delete that resource.
-
-<ruby>
-person = Person.find(1)
-person.destroy
-</ruby>
-
-h3. Validations
-
-Module to support validation and errors with Active Resource objects. The module overrides Base#save to rescue ActiveResource::ResourceInvalid exceptions and parse the errors returned in the web service response. The module also adds an errors collection that mimics the interface of the errors provided by ActiveModel::Errors.
-
-h4. Validating client side resources by overriding validation methods in base class
-
-<ruby>
-class Person < ActiveResource::Base
- self.site = "http://api.people.com:3000/"
-
- protected
-
- def validate
- errors.add("last", "has invalid characters") unless last =~ /[a-zA-Z]*/
- end
-end
-</ruby>
-
-h4. Validating client side resources
-
-Consider a Person resource on the server requiring both a first_name and a last_name with a validates_presence_of :first_name, :last_name declaration in the model:
-
-<ruby>
-person = Person.new(:first_name => "Jim", :last_name => "")
-person.save # => false (server returns an HTTP 422 status code and errors)
-person.valid? # => false
-person.errors.empty? # => false
-person.errors.count # => 1
-person.errors.full_messages # => ["Last name can't be empty"]
-person.errors[:last_name] # => ["can't be empty"]
-person.last_name = "Halpert"
-person.save # => true (and person is now saved to the remote service)
-</ruby>
-
-h4. Public instance methods
-
-ActiveResource::Validations have three public instance methods
-
-h5. errors()
-
-This will return errors object that holds all information about attribute error messages
-
-h5. save_with_validation(options=nil)
-
-This validates the resource with any local validations written in base class and then it will try to POST if there are no errors.
-
-h5. valid?
-
-Runs all the local validations and will return true if no errors.
diff --git a/railties/guides/source/command_line.textile b/railties/guides/source/command_line.textile
index fe4a84dae9..463c2b172b 100644
--- a/railties/guides/source/command_line.textile
+++ b/railties/guides/source/command_line.textile
@@ -374,7 +374,6 @@ Rails version 4.0.0.beta
JavaScript Runtime Node.js (V8)
Active Record version 4.0.0.beta
Action Pack version 4.0.0.beta
-Active Resource version 4.0.0.beta
Action Mailer version 4.0.0.beta
Active Support version 4.0.0.beta
Middleware ActionDispatch::Static, Rack::Lock, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index d6e500fc4b..49b15bd650 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -439,12 +439,6 @@ config.action_mailer.observers = ["MailObserver"]
config.action_mailer.interceptors = ["MailInterceptor"]
</ruby>
-h4. Configuring Active Resource
-
-There is a single configuration setting available on +config.active_resource+:
-
-* +config.active_resource.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby Logger class, which is then used to log information from Active Resource. Set to +nil+ to disable logging.
-
h4. Configuring Active Support
There are a few configuration options available in Active Support:
@@ -620,8 +614,6 @@ The error occurred while evaluating nil.each
*+action_mailer.compile_config_methods+* Initializes methods for the config settings specified so that they are quicker to access.
-*+active_resource.set_configs+* Sets up Active Resource by using the settings in +config.active_resource+ by +send+'ing the method names as setters to +ActiveResource::Base+ and passing the values through.
-
*+set_load_path+* This initializer runs before +bootstrap_hook+. Adds the +vendor+, +lib+, all directories of +app+ and any paths specified by +config.load_paths+ to +$LOAD_PATH+.
*+set_autoload_paths+* This initializer runs before +bootstrap_hook+. Adds all sub-directories of +app+ and paths specified by +config.autoload_paths+ to +ActiveSupport::Dependencies.autoload_paths+.
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index bed14ef6a8..3a84b69fc3 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -116,7 +116,6 @@ need to know anything about them to continue with this guide.
* Action Mailer
* Active Model
* Active Record
-* Active Resource
* Active Support
* Railties
@@ -167,12 +166,6 @@ Active Record is the base for the models in a Rails application. It provides
database independence, basic CRUD functionality, advanced finding capabilities,
and the ability to relate models to one another, among other services.
-h5. Active Resource
-
-Active Resource provides a framework for managing the connection between
-business objects and RESTful web services. It implements a way to map web-based
-resources to local objects with CRUD semantics.
-
h5. Active Support
Active Support is an extensive collection of utility classes and standard Ruby
diff --git a/railties/guides/source/initialization.textile b/railties/guides/source/initialization.textile
index 5ae9cf0f2b..69e5c1edcc 100644
--- a/railties/guides/source/initialization.textile
+++ b/railties/guides/source/initialization.textile
@@ -159,7 +159,6 @@ In a standard Rails application, there's a +Gemfile+ which declares all dependen
* actionpack (3.1.0.beta)
* activemodel (3.1.0.beta)
* activerecord (3.1.0.beta)
-* activeresource (3.1.0.beta)
* activesupport (3.1.0.beta)
* arel (2.0.7)
* builder (3.0.0)
@@ -491,7 +490,6 @@ require "rails"
active_record
action_controller
action_mailer
- active_resource
rails/test_unit
).each do |framework|
begin