1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #19566 from aditya-kapoor/remove-dup-doc

[ci skip] remove duplicate doc for current_page?
This commit is contained in:
Richard Schneeman 2015-04-11 17:24:14 -05:00
commit 29d40544b1

View file

@ -476,21 +476,27 @@ module ActionView
# True if the current request URI was generated by the given +options+. # True if the current request URI was generated by the given +options+.
# #
# ==== Examples # ==== Examples
# Let's say we're in the <tt>http://www.example.com/shop/checkout?order=desc</tt> action. # Let's say we're in the <tt>http://www.example.com/shop/checkout?order=desc&page=1</tt> action.
# #
# current_page?(action: 'process') # current_page?(action: 'process')
# # => false # # => false
# #
# current_page?(action: 'checkout')
# # => true
#
# current_page?(controller: 'library', action: 'checkout')
# # => false
#
# current_page?(controller: 'shop', action: 'checkout') # current_page?(controller: 'shop', action: 'checkout')
# # => true # # => true
# #
# current_page?(controller: 'shop', action: 'checkout', order: 'asc') # current_page?(controller: 'shop', action: 'checkout', order: 'asc')
# # => false # # => false
# #
# current_page?(action: 'checkout') # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1')
# # => true # # => true
# #
# current_page?(controller: 'library', action: 'checkout') # current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2')
# # => false # # => false
# #
# current_page?('http://www.example.com/shop/checkout') # current_page?('http://www.example.com/shop/checkout')
@ -499,34 +505,16 @@ module ActionView
# current_page?('/shop/checkout') # current_page?('/shop/checkout')
# # => true # # => true
# #
# Let's say we're in the <tt>http://www.example.com/shop/checkout?order=desc&page=1</tt> action. # current_page?('http://www.example.com/shop/checkout?order=desc&page=1')
#
# current_page?(action: 'process')
# # => false
#
# current_page?(controller: 'shop', action: 'checkout')
# # => true # # => true
# #
# current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '1')
# # => true
#
# current_page?(controller: 'shop', action: 'checkout', order: 'desc', page: '2')
# # => false
#
# current_page?(controller: 'shop', action: 'checkout', order: 'desc')
# # => false
#
# current_page?(action: 'checkout')
# # => true
#
# current_page?(controller: 'library', action: 'checkout')
# # => false
#
# Let's say we're in the <tt>http://www.example.com/products</tt> action with method POST in case of invalid product. # Let's say we're in the <tt>http://www.example.com/products</tt> action with method POST in case of invalid product.
# #
# current_page?(controller: 'product', action: 'index') # current_page?(controller: 'product', action: 'index')
# # => false # # => false
# #
# We can also pass in the symbol arguments instead of strings.
#
def current_page?(options) def current_page?(options)
unless request unless request
raise "You cannot use helpers that need to determine the current " \ raise "You cannot use helpers that need to determine the current " \