public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Fixed UrlHelper#link_to_unless so it doesn't care if the id is a string or 
fixnum [zenspider]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@256 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Wed Dec 22 14:50:44 -0800 2004
commit  d91405a415819a626427373437e0929b19914cf4
tree    55b9ffef39c7d782d664b9bd2bb7b100e321bd29
parent  a89e36a22a558a77e6783d21ce4f9deee028e2e9
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Fixed UrlHelper#link_to_unless so it doesn't care if the id is a string or fixnum [zenspider]
0
+
0
 * Added search through session to clear out association caches at the end of each request. This makes it possible to place Active Record objects
0
   in the session without worrying about stale data in the associations (the main object is still subject to caching, naturally) #347 [Tobias Luetke]
0
 
...
1
 
2
3
4
...
1
2
3
4
5
0
@@ -1,4 +1,5 @@
0
 require 'cgi'
0
+require 'erb'
0
 
0
 module ActionView
0
   module Helpers
...
96
97
98
99
100
101
 
 
 
102
103
104
...
96
97
98
 
 
 
99
100
101
102
103
104
0
@@ -96,9 +96,9 @@
0
         def destination_equal_to_current(options)
0
           params_without_location = @params.reject { |key, value| %w( controller action id ).include?(key) }
0
 
0
- options[:action] == @params['action'] &&
0
- options[:id] == @params['id'] &&
0
- options[:controller] == @params['controller'] &&
0
+ options[:action].to_s == @params['action'].to_s &&
0
+ options[:id].to_s == @params['id'].to_s &&
0
+ options[:controller].to_s == @params['controller'].to_s &&
0
             (options.has_key?(:params) ? params_without_location == options[:params] : true)
0
         end
0
 
...
43
44
45
 
 
 
46
47
48
...
43
44
45
46
47
48
49
50
51
0
@@ -43,6 +43,9 @@
0
     @params = { "controller" => "weblog", "action" => "show"}
0
     assert_equal "Showing", link_to_unless_current("Showing", :action => "show", :controller => "weblog")
0
     assert "<a href=\"http://www.world.com\">Listing</a>", link_to_unless_current("Listing", :action => "list", :controller => "weblog")
0
+
0
+ @params = { "controller" => "weblog", "action" => "show", "id" => "1"}
0
+ assert_equal "Showing", link_to_unless_current("Showing", :action => "show", :controller => "weblog", :id => 1)
0
   end
0
 
0
   def test_mail_to

Comments

    No one has commented yet.