From 357578256fb55e32ae87c6fbf22a1c19f59ce264 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Tue, 5 Apr 2011 21:22:10 +1000 Subject: Correct documentation on url_for. It doesn't call to_s, but rather to_param --- actionpack/lib/action_view/helpers/url_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 2cd2dca711..6496397c31 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -81,9 +81,12 @@ module ActionView # # => /workshops # # <%= url_for(@workshop) %> - # # calls @workshop.to_s + # # calls @workshop.to_param which by default returns the id # # => /workshops/5 # + # # to_param can be re-defined in a model to provide different URL names: + # # => /workshops/1-workshop-name + # # <%= url_for("http://www.example.com") %> # # => http://www.example.com # -- cgit v1.2.3 From c59456a1d92892cd98c34f348e16c4de6af92306 Mon Sep 17 00:00:00 2001 From: Jo Liss Date: Fri, 8 Apr 2011 20:56:38 +0200 Subject: removed :nodoc: from ActionController::MimeResponds So we don't miss out on the nice documentation of the respond_to and respond_with instance methods. Also added :nodoc: to protected method. --- actionpack/lib/action_controller/metal/mime_responds.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index 6469e24d36..0f6bc10dd5 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -2,7 +2,7 @@ require 'abstract_controller/collector' require 'active_support/core_ext/class/attribute' module ActionController #:nodoc: - module MimeResponds #:nodoc: + module MimeResponds extend ActiveSupport::Concern included do @@ -260,7 +260,7 @@ module ActionController #:nodoc: # Collects mimes and return the response for the negotiated format. Returns # nil if :not_acceptable was sent to the client. # - def retrieve_response_from_mimes(mimes=nil, &block) + def retrieve_response_from_mimes(mimes=nil, &block) #:nodoc: mimes ||= collect_mimes_from_class_level collector = Collector.new(mimes) { |options| default_render(options || {}) } block.call(collector) if block_given? -- cgit v1.2.3 From d5634b2287cda70d4a53a70424f1a3fdc95562f6 Mon Sep 17 00:00:00 2001 From: Oge Nnadi Date: Mon, 11 Apr 2011 13:08:58 -0700 Subject: Added missing --- actionpack/lib/abstract_controller/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb index 95992c2698..f7b2b7ff53 100644 --- a/actionpack/lib/abstract_controller/callbacks.rb +++ b/actionpack/lib/abstract_controller/callbacks.rb @@ -29,7 +29,7 @@ module AbstractController # # ==== Options # * only - The callback should be run only for this action - # * except - The callback should be run for all actions except this action + # * except - The callback should be run for all actions except this action def _normalize_callback_options(options) if only = options[:only] only = Array(only).map {|o| "action_name == '#{o}'"}.join(" || ") -- cgit v1.2.3