aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/actionpack.gemspec31
-rw-r--r--actionpack/lib/action_controller/metal/instrumentation.rb4
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb3
-rw-r--r--actionpack/lib/action_pack/version.rb2
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb21
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb4
-rw-r--r--actionpack/test/template/form_helper_test.rb6
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb4
8 files changed, 32 insertions, 43 deletions
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec
index dc91fba64d..2017776661 100644
--- a/actionpack/actionpack.gemspec
+++ b/actionpack/actionpack.gemspec
@@ -1,26 +1,25 @@
Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = 'actionpack'
- s.version = '3.0.pre'
- s.summary = "Web-flow and rendering framework putting the VC in MVC."
- s.description = %q{Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.} #'
+ s.platform = Gem::Platform::RUBY
+ s.name = 'actionpack'
+ s.version = '3.0.0.beta'
+ s.summary = 'Web-flow and rendering framework putting the VC in MVC (part of Rails).'
+ s.description = 'Web-flow and rendering framework putting the VC in MVC (part of Rails).'
- s.author = "David Heinemeier Hansson"
- s.email = "david@loudthinking.com"
- s.rubyforge_project = "actionpack"
- s.homepage = "http://www.rubyonrails.org"
+ s.author = 'David Heinemeier Hansson'
+ s.email = 'david@loudthinking.com'
+ s.homepage = 'http://www.rubyonrails.org'
+ s.rubyforge_project = 'actionpack'
- s.files = Dir['CHANGELOG', 'README', 'MIT-LICENSE', 'lib/**/*']
- s.has_rdoc = true
+ s.files = Dir['CHANGELOG', 'README', 'MIT-LICENSE', 'lib/**/*']
+ s.require_path = 'lib'
s.requirements << 'none'
- s.add_dependency('activesupport', '= 3.0.pre')
- s.add_dependency('activemodel', '= 3.0.pre')
+ s.has_rdoc = true
+
+ s.add_dependency('activesupport', '= 3.0.0.beta')
+ s.add_dependency('activemodel', '= 3.0.0.beta')
s.add_dependency('rack', '~> 1.1.0')
s.add_dependency('rack-test', '~> 0.5.0')
s.add_dependency('rack-mount', '~> 0.4.0')
s.add_dependency('erubis', '~> 2.6.5')
-
- s.require_path = 'lib'
- s.autorequire = 'action_controller'
end
diff --git a/actionpack/lib/action_controller/metal/instrumentation.rb b/actionpack/lib/action_controller/metal/instrumentation.rb
index 7f9a7c068b..85035dc09c 100644
--- a/actionpack/lib/action_controller/metal/instrumentation.rb
+++ b/actionpack/lib/action_controller/metal/instrumentation.rb
@@ -18,7 +18,9 @@ module ActionController
:controller => self.class.name,
:action => self.action_name,
:params => request.filtered_parameters,
- :formats => request.formats.map(&:to_sym)
+ :formats => request.formats.map(&:to_sym),
+ :method => request.method,
+ :path => (request.request_uri rescue "unknown")
}
ActiveSupport::Notifications.instrument("action_controller.start_processing", raw_payload.dup)
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 5199984814..8de68b3174 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -207,8 +207,7 @@ module ActionDispatch
lambda do |env|
req = Request.new(env)
-
- uri = URI.parse(path_proc.call(req.params.symbolize_keys))
+ uri = URI.parse(path_proc.call(req.symbolized_path_parameters))
uri.scheme ||= req.scheme
uri.host ||= req.host
uri.port ||= req.port unless req.port == 80
diff --git a/actionpack/lib/action_pack/version.rb b/actionpack/lib/action_pack/version.rb
index ed0cdf38ee..4dde21dd40 100644
--- a/actionpack/lib/action_pack/version.rb
+++ b/actionpack/lib/action_pack/version.rb
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 3
MINOR = 0
- TINY = "pre"
+ TINY = "0.beta"
STRING = [MAJOR, MINOR, TINY].join('.')
end
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 1d91b6957a..4d29a03b92 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -528,7 +528,7 @@ module ActionView
object_name = ActionController::RecordIdentifier.singular_class_name(object)
end
- builder = options[:builder] || ActionView.default_form_builder
+ builder = options[:builder] || ActionView::Base.default_form_builder
yield builder.new(object_name, object, self, options, block)
end
@@ -1208,21 +1208,8 @@ module ActionView
end
end
- class << ActionView
- attr_accessor :default_form_builder
+ class Base
+ cattr_accessor :default_form_builder
+ @@default_form_builder = ::ActionView::Helpers::FormBuilder
end
-
- self.default_form_builder = ::ActionView::Helpers::FormBuilder
-
- # 2.3 compatibility
- class << Base
- def default_form_builder=(builder)
- ActionView.default_form_builder = builder
- end
-
- def default_form_builder
- ActionView.default_form_builder
- end
- end
-
end
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index 9b8471c6c6..ba1b0bcc20 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -329,9 +329,7 @@ module ActionView
# radio_button_tag 'color', "green", true, :class => "color_input"
# # => <input checked="checked" class="color_input" id="color_green" name="color" type="radio" value="green" />
def radio_button_tag(name, value, checked = false, options = {})
- pretty_tag_value = value.to_s.gsub(/\s/, "_").gsub(/(?!-)\W/, "").downcase
- pretty_name = name.to_s.gsub(/\[/, "_").gsub(/\]/, "")
- html_options = { "type" => "radio", "name" => name, "id" => "#{pretty_name}_#{pretty_tag_value}", "value" => value }.update(options.stringify_keys)
+ html_options = { "type" => "radio", "name" => name, "id" => "#{sanitize_to_id(name)}_#{sanitize_to_id(value)}", "value" => value }.update(options.stringify_keys)
html_options["checked"] = "checked" if checked
tag :input, html_options
end
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index aafc318b76..f2d524bd1b 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -1195,8 +1195,8 @@ class FormHelperTest < ActionView::TestCase
end
def test_default_form_builder
- old_default_form_builder, ActionView.default_form_builder =
- ActionView.default_form_builder, LabelledFormBuilder
+ old_default_form_builder, ActionView::Base.default_form_builder =
+ ActionView::Base.default_form_builder, LabelledFormBuilder
form_for(:post, @post) do |f|
concat f.text_field(:title)
@@ -1213,7 +1213,7 @@ class FormHelperTest < ActionView::TestCase
assert_dom_equal expected, output_buffer
ensure
- ActionView.default_form_builder = old_default_form_builder
+ ActionView::Base.default_form_builder = old_default_form_builder
end
def test_default_form_builder_with_active_record_helpers
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 3635c7548e..6ac5df1ea9 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -120,6 +120,10 @@ class FormTagHelperTest < ActionView::TestCase
actual = radio_button_tag("person[gender]", "m")
expected = %(<input id="person_gender_m" name="person[gender]" type="radio" value="m" />)
assert_dom_equal expected, actual
+
+ actual = radio_button_tag('ctrlname', 'apache2.2')
+ expected = %(<input id="ctrlname_apache2.2" name="ctrlname" type="radio" value="apache2.2" />)
+ assert_dom_equal expected, actual
end
def test_select_tag