actionpack 1.13.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +1400 -20
- data/MIT-LICENSE +1 -1
- data/README +5 -5
- data/RUNNING_UNIT_TESTS +4 -5
- data/Rakefile +5 -6
- data/install.rb +2 -2
- data/lib/action_controller.rb +11 -15
- data/lib/action_controller/assertions.rb +12 -25
- data/lib/action_controller/assertions/dom_assertions.rb +18 -4
- data/lib/action_controller/assertions/model_assertions.rb +8 -1
- data/lib/action_controller/assertions/response_assertions.rb +35 -12
- data/lib/action_controller/assertions/routing_assertions.rb +56 -12
- data/lib/action_controller/assertions/selector_assertions.rb +105 -38
- data/lib/action_controller/assertions/tag_assertions.rb +28 -15
- data/lib/action_controller/base.rb +318 -250
- data/lib/action_controller/benchmarking.rb +33 -29
- data/lib/action_controller/caching.rb +130 -64
- data/lib/action_controller/cgi_ext.rb +16 -0
- data/lib/action_controller/cgi_ext/{cookie_performance_fix.rb → cookie.rb} +25 -40
- data/lib/action_controller/cgi_ext/query_extension.rb +22 -0
- data/lib/action_controller/cgi_ext/session.rb +73 -0
- data/lib/action_controller/cgi_ext/stdinput.rb +23 -0
- data/lib/action_controller/cgi_process.rb +34 -57
- data/lib/action_controller/components.rb +19 -36
- data/lib/action_controller/cookies.rb +10 -9
- data/lib/action_controller/dispatcher.rb +195 -0
- data/lib/action_controller/filters.rb +35 -34
- data/lib/action_controller/flash.rb +30 -35
- data/lib/action_controller/helpers.rb +121 -47
- data/lib/action_controller/http_authentication.rb +126 -0
- data/lib/action_controller/integration.rb +105 -101
- data/lib/action_controller/layout.rb +59 -47
- data/lib/action_controller/mime_responds.rb +57 -68
- data/lib/action_controller/mime_type.rb +43 -80
- data/lib/action_controller/mime_types.rb +20 -0
- data/lib/action_controller/polymorphic_routes.rb +88 -0
- data/lib/action_controller/record_identifier.rb +91 -0
- data/lib/action_controller/request.rb +553 -88
- data/lib/action_controller/request_forgery_protection.rb +126 -0
- data/lib/action_controller/request_profiler.rb +138 -0
- data/lib/action_controller/rescue.rb +185 -69
- data/lib/action_controller/resources.rb +211 -172
- data/lib/action_controller/response.rb +49 -8
- data/lib/action_controller/routing.rb +359 -236
- data/lib/action_controller/routing_optimisation.rb +119 -0
- data/lib/action_controller/session/active_record_store.rb +3 -2
- data/lib/action_controller/session/cookie_store.rb +161 -0
- data/lib/action_controller/session/mem_cache_store.rb +9 -16
- data/lib/action_controller/session_management.rb +17 -8
- data/lib/action_controller/streaming.rb +6 -3
- data/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
- data/lib/action_controller/templates/rescues/{_trace.rhtml → _trace.erb} +0 -0
- data/lib/action_controller/templates/rescues/{diagnostics.rhtml → diagnostics.erb} +2 -2
- data/lib/action_controller/templates/rescues/{layout.rhtml → layout.erb} +0 -0
- data/lib/action_controller/templates/rescues/{missing_template.rhtml → missing_template.erb} +0 -0
- data/lib/action_controller/templates/rescues/{routing_error.rhtml → routing_error.erb} +0 -0
- data/lib/action_controller/templates/rescues/{template_error.rhtml → template_error.erb} +2 -2
- data/lib/action_controller/templates/rescues/{unknown_action.rhtml → unknown_action.erb} +0 -0
- data/lib/action_controller/test_case.rb +53 -0
- data/lib/action_controller/test_process.rb +59 -46
- data/lib/action_controller/url_rewriter.rb +48 -24
- data/lib/action_controller/vendor/html-scanner/html/document.rb +7 -4
- data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +173 -0
- data/lib/action_controller/vendor/html-scanner/html/selector.rb +11 -6
- data/lib/action_controller/verification.rb +27 -21
- data/lib/action_pack.rb +1 -1
- data/lib/action_pack/version.rb +4 -4
- data/lib/action_view.rb +2 -3
- data/lib/action_view/base.rb +218 -63
- data/lib/action_view/compiled_templates.rb +1 -2
- data/lib/action_view/helpers/active_record_helper.rb +35 -17
- data/lib/action_view/helpers/asset_tag_helper.rb +395 -87
- data/lib/action_view/helpers/atom_feed_helper.rb +111 -0
- data/lib/action_view/helpers/benchmark_helper.rb +12 -5
- data/lib/action_view/helpers/cache_helper.rb +29 -0
- data/lib/action_view/helpers/capture_helper.rb +97 -63
- data/lib/action_view/helpers/date_helper.rb +295 -35
- data/lib/action_view/helpers/debug_helper.rb +6 -2
- data/lib/action_view/helpers/form_helper.rb +354 -111
- data/lib/action_view/helpers/form_options_helper.rb +171 -109
- data/lib/action_view/helpers/form_tag_helper.rb +332 -76
- data/lib/action_view/helpers/javascript_helper.rb +35 -11
- data/lib/action_view/helpers/javascripts/controls.js +484 -354
- data/lib/action_view/helpers/javascripts/dragdrop.js +88 -58
- data/lib/action_view/helpers/javascripts/effects.js +396 -364
- data/lib/action_view/helpers/javascripts/prototype.js +2817 -1107
- data/lib/action_view/helpers/number_helper.rb +84 -60
- data/lib/action_view/helpers/prototype_helper.rb +419 -43
- data/lib/action_view/helpers/record_identification_helper.rb +20 -0
- data/lib/action_view/helpers/record_tag_helper.rb +59 -0
- data/lib/action_view/helpers/sanitize_helper.rb +223 -0
- data/lib/action_view/helpers/scriptaculous_helper.rb +63 -4
- data/lib/action_view/helpers/tag_helper.rb +69 -39
- data/lib/action_view/helpers/text_helper.rb +221 -148
- data/lib/action_view/helpers/url_helper.rb +283 -165
- data/lib/action_view/partials.rb +134 -62
- data/lib/action_view/template_error.rb +4 -12
- data/lib/actionpack.rb +1 -0
- data/test/abstract_unit.rb +21 -1
- data/test/action_view_test.rb +26 -0
- data/test/active_record_unit.rb +12 -20
- data/test/activerecord/active_record_store_test.rb +2 -2
- data/test/activerecord/render_partial_with_record_identification_test.rb +74 -0
- data/test/controller/action_pack_assertions_test.rb +21 -152
- data/test/controller/addresses_render_test.rb +2 -7
- data/test/controller/assert_select_test.rb +120 -14
- data/test/controller/base_test.rb +11 -13
- data/test/controller/caching_test.rb +125 -5
- data/test/controller/capture_test.rb +23 -16
- data/test/controller/cgi_test.rb +66 -391
- data/test/controller/components_test.rb +31 -42
- data/test/controller/content_type_test.rb +1 -1
- data/test/controller/cookie_test.rb +42 -14
- data/test/controller/deprecation/deprecated_base_methods_test.rb +1 -42
- data/test/controller/dispatcher_test.rb +123 -0
- data/test/controller/fake_models.rb +5 -0
- data/test/controller/filters_test.rb +44 -7
- data/test/controller/flash_test.rb +46 -2
- data/test/controller/fragment_store_setting_test.rb +10 -8
- data/test/controller/helper_test.rb +19 -2
- data/test/controller/html-scanner/document_test.rb +124 -0
- data/test/controller/html-scanner/node_test.rb +69 -0
- data/test/controller/html-scanner/sanitizer_test.rb +250 -0
- data/test/controller/html-scanner/tag_node_test.rb +239 -0
- data/test/controller/html-scanner/text_node_test.rb +51 -0
- data/test/controller/html-scanner/tokenizer_test.rb +125 -0
- data/test/controller/http_authentication_test.rb +54 -0
- data/test/controller/integration_test.rb +12 -26
- data/test/controller/layout_test.rb +64 -12
- data/test/controller/mime_responds_test.rb +193 -38
- data/test/controller/mime_type_test.rb +30 -8
- data/test/controller/new_render_test.rb +104 -22
- data/test/controller/polymorphic_routes_test.rb +98 -0
- data/test/controller/record_identifier_test.rb +103 -0
- data/test/controller/redirect_test.rb +120 -18
- data/test/controller/render_test.rb +195 -45
- data/test/controller/request_forgery_protection_test.rb +217 -0
- data/test/controller/request_test.rb +545 -27
- data/test/controller/rescue_test.rb +501 -0
- data/test/controller/resources_test.rb +258 -132
- data/test/controller/routing_test.rb +502 -106
- data/test/controller/selector_test.rb +5 -5
- data/test/controller/send_file_test.rb +17 -7
- data/test/controller/session/cookie_store_test.rb +246 -0
- data/test/controller/session/mem_cache_store_test.rb +182 -0
- data/test/controller/session_fixation_test.rb +8 -11
- data/test/controller/session_management_test.rb +7 -7
- data/test/controller/test_test.rb +150 -38
- data/test/controller/url_rewriter_test.rb +87 -12
- data/test/controller/verification_test.rb +11 -0
- data/test/controller/view_paths_test.rb +137 -0
- data/test/controller/webservice_test.rb +11 -75
- data/test/fixtures/addresses/{list.rhtml → list.erb} +0 -0
- data/test/fixtures/db_definitions/sqlite.sql +2 -1
- data/test/fixtures/developer.rb +2 -0
- data/test/fixtures/fun/games/{hello_world.rhtml → hello_world.erb} +0 -0
- data/test/fixtures/helpers/fun/pdf_helper.rb +1 -1
- data/test/fixtures/layout_tests/alt/hello.rhtml +1 -0
- data/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/test/fixtures/layouts/{builder.rxml → builder.builder} +0 -0
- data/test/fixtures/layouts/{standard.rhtml → standard.erb} +0 -0
- data/test/fixtures/layouts/{talk_from_action.rhtml → talk_from_action.erb} +0 -0
- data/test/fixtures/layouts/{yield.rhtml → yield.erb} +0 -0
- data/test/fixtures/multipart/binary_file +0 -0
- data/test/fixtures/multipart/bracketed_param +5 -0
- data/test/fixtures/override/test/hello_world.erb +1 -0
- data/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/test/fixtures/post_test/post/index.html.erb +1 -0
- data/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/test/fixtures/public/404.html +1 -0
- data/test/fixtures/public/500.html +1 -0
- data/test/fixtures/public/javascripts/application.js +0 -1
- data/test/fixtures/public/javascripts/bank.js +1 -0
- data/test/fixtures/public/javascripts/robber.js +1 -0
- data/test/fixtures/public/stylesheets/bank.css +1 -0
- data/test/fixtures/public/stylesheets/robber.css +1 -0
- data/test/fixtures/replies.yml +2 -0
- data/test/fixtures/reply.rb +2 -1
- data/test/fixtures/respond_to/{all_types_with_layout.rhtml → all_types_with_layout.html.erb} +0 -0
- data/test/fixtures/respond_to/{all_types_with_layout.rjs → all_types_with_layout.js.rjs} +0 -0
- data/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/test/fixtures/respond_to/{using_defaults.rhtml → using_defaults.html.erb} +0 -0
- data/test/fixtures/respond_to/{using_defaults.rjs → using_defaults.js.rjs} +0 -0
- data/test/fixtures/respond_to/{using_defaults.rxml → using_defaults.xml.builder} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rhtml → using_defaults_with_type_list.html.erb} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rjs → using_defaults_with_type_list.js.rjs} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rxml → using_defaults_with_type_list.xml.builder} +0 -0
- data/test/fixtures/scope/test/{modgreet.rhtml → modgreet.erb} +0 -0
- data/test/fixtures/test/{_customer.rhtml → _customer.erb} +0 -0
- data/test/fixtures/test/{_customer_greeting.rhtml → _customer_greeting.erb} +0 -0
- data/test/fixtures/test/_hash_greeting.erb +1 -0
- data/test/fixtures/test/_hash_object.erb +2 -0
- data/test/fixtures/test/{_hello.rxml → _hello.builder} +0 -0
- data/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/test/fixtures/test/_partial.erb +1 -0
- data/test/fixtures/test/_partial.html.erb +1 -0
- data/test/fixtures/test/_partial.js.erb +1 -0
- data/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/test/fixtures/test/{_partial_only.rhtml → _partial_only.erb} +0 -0
- data/test/fixtures/test/{_person.rhtml → _person.erb} +0 -0
- data/test/fixtures/test/{action_talk_to_layout.rhtml → action_talk_to_layout.erb} +0 -0
- data/test/fixtures/test/{block_content_for.rhtml → block_content_for.erb} +0 -0
- data/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/test/fixtures/test/{capturing.rhtml → capturing.erb} +0 -0
- data/test/fixtures/test/{content_for.rhtml → content_for.erb} +0 -0
- data/test/fixtures/test/content_for_concatenated.erb +3 -0
- data/test/fixtures/test/content_for_with_parameter.erb +2 -0
- data/test/fixtures/test/dot.directory/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/test/fixtures/test/{erb_content_for.rhtml → erb_content_for.erb} +0 -0
- data/test/fixtures/test/formatted_html_erb.html.erb +1 -0
- data/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/test/fixtures/test/{greeting.rhtml → greeting.erb} +0 -0
- data/test/fixtures/test/{hello.rxml → hello.builder} +0 -0
- data/test/fixtures/test/{hello_world.rxml → hello_world.builder} +0 -0
- data/test/fixtures/test/{hello_world.rhtml → hello_world.erb} +0 -0
- data/test/fixtures/test/{hello_world_container.rxml → hello_world_container.builder} +0 -0
- data/test/fixtures/test/{hello_world_with_layout_false.rhtml → hello_world_with_layout_false.erb} +0 -0
- data/test/fixtures/test/{hello_xml_world.rxml → hello_xml_world.builder} +0 -0
- data/test/fixtures/test/list.erb +1 -0
- data/test/fixtures/test/{non_erb_block_content_for.rxml → non_erb_block_content_for.builder} +0 -0
- data/test/fixtures/test/{potential_conflicts.rhtml → potential_conflicts.erb} +0 -0
- data/test/fixtures/test/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/test/fixtures/test/{render_file_with_locals.rhtml → render_file_with_locals.erb} +0 -0
- data/test/fixtures/test/{render_to_string_test.rhtml → render_to_string_test.erb} +0 -0
- data/test/fixtures/test/{update_element_with_capture.rhtml → update_element_with_capture.erb} +0 -0
- data/test/fixtures/test/using_layout_around_block.html.erb +1 -0
- data/test/fixtures/topic.rb +1 -1
- data/test/template/active_record_helper_test.rb +67 -20
- data/test/template/asset_tag_helper_test.rb +222 -54
- data/test/template/atom_feed_helper_test.rb +101 -0
- data/test/template/benchmark_helper_test.rb +2 -2
- data/test/template/compiled_templates_test.rb +76 -32
- data/test/template/date_helper_test.rb +125 -9
- data/test/template/form_helper_test.rb +326 -33
- data/test/template/form_options_helper_test.rb +822 -15
- data/test/template/form_tag_helper_test.rb +96 -30
- data/test/template/javascript_helper_test.rb +61 -13
- data/test/template/number_helper_test.rb +12 -11
- data/test/template/prototype_helper_test.rb +185 -24
- data/test/template/sanitize_helper_test.rb +49 -0
- data/test/template/scriptaculous_helper_test.rb +9 -3
- data/test/template/tag_helper_test.rb +13 -2
- data/test/template/text_helper_test.rb +38 -52
- data/test/template/url_helper_test.rb +216 -46
- metadata +144 -116
- data/examples/.htaccess +0 -24
- data/examples/address_book/index.rhtml +0 -33
- data/examples/address_book/layout.rhtml +0 -8
- data/examples/address_book_controller.cgi +0 -9
- data/examples/address_book_controller.fcgi +0 -6
- data/examples/address_book_controller.rb +0 -52
- data/examples/address_book_controller.rbx +0 -4
- data/examples/benchmark.rb +0 -52
- data/examples/benchmark_with_ar.fcgi +0 -89
- data/examples/blog_controller.cgi +0 -53
- data/examples/debate/index.rhtml +0 -14
- data/examples/debate/new_topic.rhtml +0 -22
- data/examples/debate/topic.rhtml +0 -32
- data/examples/debate_controller.cgi +0 -57
- data/lib/action_controller/assertions/deprecated_assertions.rb +0 -228
- data/lib/action_controller/cgi_ext/cgi_ext.rb +0 -36
- data/lib/action_controller/cgi_ext/cgi_methods.rb +0 -211
- data/lib/action_controller/cgi_ext/pstore_performance_fix.rb +0 -30
- data/lib/action_controller/cgi_ext/raw_post_data_fix.rb +0 -95
- data/lib/action_controller/cgi_ext/session_performance_fix.rb +0 -30
- data/lib/action_controller/deprecated_dependencies.rb +0 -65
- data/lib/action_controller/deprecated_redirects.rb +0 -17
- data/lib/action_controller/deprecated_request_methods.rb +0 -34
- data/lib/action_controller/macros/auto_complete.rb +0 -53
- data/lib/action_controller/macros/in_place_editing.rb +0 -33
- data/lib/action_controller/pagination.rb +0 -408
- data/lib/action_controller/scaffolding.rb +0 -189
- data/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -44
- data/lib/action_controller/templates/scaffolds/edit.rhtml +0 -7
- data/lib/action_controller/templates/scaffolds/layout.rhtml +0 -69
- data/lib/action_controller/templates/scaffolds/list.rhtml +0 -27
- data/lib/action_controller/templates/scaffolds/new.rhtml +0 -6
- data/lib/action_controller/templates/scaffolds/show.rhtml +0 -9
- data/lib/action_controller/vendor/xml_node.rb +0 -97
- data/lib/action_view/helpers/deprecated_helper.rb +0 -37
- data/lib/action_view/helpers/java_script_macros_helper.rb +0 -233
- data/lib/action_view/helpers/pagination_helper.rb +0 -86
- data/test/activerecord/active_record_assertions_test.rb +0 -92
- data/test/activerecord/pagination_test.rb +0 -165
- data/test/controller/deprecated_instance_variables_test.rb +0 -48
- data/test/controller/raw_post_test.rb +0 -68
- data/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_params_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_request_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_response_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_session_method.rhtml +0 -1
- data/test/fixtures/respond_to/layouts/standard.rhtml +0 -1
- data/test/fixtures/test/_hash_object.rhtml +0 -1
- data/test/fixtures/test/list.rhtml +0 -1
- data/test/template/deprecated_helper_test.rb +0 -36
- data/test/template/deprecated_instance_variables_test.rb +0 -43
- data/test/template/java_script_macros_helper_test.rb +0 -109
@@ -23,18 +23,19 @@ module ActionController #:nodoc:
|
|
23
23
|
# * <tt>domain</tt> - the domain for which this cookie applies.
|
24
24
|
# * <tt>expires</tt> - the time at which this cookie expires, as a +Time+ object.
|
25
25
|
# * <tt>secure</tt> - whether this cookie is a secure cookie or not (default to false).
|
26
|
-
#
|
26
|
+
# Secure cookies are only transmitted to HTTPS servers.
|
27
|
+
# * <tt>http_only</tt> - whether this cookie is accessible via scripting or only HTTP (defaults to false).
|
28
|
+
|
27
29
|
module Cookies
|
30
|
+
def self.included(base)
|
31
|
+
base.helper_method :cookies
|
32
|
+
end
|
33
|
+
|
28
34
|
protected
|
29
35
|
# Returns the cookie container, which operates as described above.
|
30
36
|
def cookies
|
31
37
|
CookieJar.new(self)
|
32
38
|
end
|
33
|
-
|
34
|
-
# Deprecated cookie writer method
|
35
|
-
def cookie(*options)
|
36
|
-
response.headers['cookie'] << CGI::Cookie.new(*options)
|
37
|
-
end
|
38
39
|
end
|
39
40
|
|
40
41
|
class CookieJar < Hash #:nodoc:
|
@@ -44,8 +45,8 @@ module ActionController #:nodoc:
|
|
44
45
|
update(@cookies)
|
45
46
|
end
|
46
47
|
|
47
|
-
# Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using
|
48
|
-
#
|
48
|
+
# Returns the value of the cookie by +name+ -- or nil if no such cookie exists. You set new cookies using cookies[]=
|
49
|
+
# (for simple name/value cookies without options).
|
49
50
|
def [](name)
|
50
51
|
cookie = @cookies[name.to_s]
|
51
52
|
if cookie && cookie.respond_to?(:value)
|
@@ -80,4 +81,4 @@ module ActionController #:nodoc:
|
|
80
81
|
@controller.response.headers["cookie"] << cookie
|
81
82
|
end
|
82
83
|
end
|
83
|
-
end
|
84
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
module ActionController
|
2
|
+
# Dispatches requests to the appropriate controller and takes care of
|
3
|
+
# reloading the app after each request when Dependencies.load? is true.
|
4
|
+
class Dispatcher
|
5
|
+
class << self
|
6
|
+
# Backward-compatible class method takes CGI-specific args. Deprecated
|
7
|
+
# in favor of Dispatcher.new(output, request, response).dispatch!
|
8
|
+
def dispatch(cgi = nil, session_options = CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout)
|
9
|
+
new(output).dispatch_cgi(cgi, session_options)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Declare a block to be called before each dispatch.
|
13
|
+
# Run in the order declared.
|
14
|
+
def before_dispatch(*method_names, &block)
|
15
|
+
callbacks[:before].concat method_names
|
16
|
+
callbacks[:before] << block if block_given?
|
17
|
+
end
|
18
|
+
|
19
|
+
# Declare a block to be called after each dispatch.
|
20
|
+
# Run in reverse of the order declared.
|
21
|
+
def after_dispatch(*method_names, &block)
|
22
|
+
callbacks[:after].concat method_names
|
23
|
+
callbacks[:after] << block if block_given?
|
24
|
+
end
|
25
|
+
|
26
|
+
# Add a preparation callback. Preparation callbacks are run before every
|
27
|
+
# request in development mode, and before the first request in production
|
28
|
+
# mode.
|
29
|
+
#
|
30
|
+
# An optional identifier may be supplied for the callback. If provided,
|
31
|
+
# to_prepare may be called again with the same identifier to replace the
|
32
|
+
# existing callback. Passing an identifier is a suggested practice if the
|
33
|
+
# code adding a preparation block may be reloaded.
|
34
|
+
def to_prepare(identifier = nil, &block)
|
35
|
+
# Already registered: update the existing callback
|
36
|
+
if identifier
|
37
|
+
if callback = callbacks[:prepare].assoc(identifier)
|
38
|
+
callback[1] = block
|
39
|
+
else
|
40
|
+
callbacks[:prepare] << [identifier, block]
|
41
|
+
end
|
42
|
+
else
|
43
|
+
callbacks[:prepare] << block
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# If the block raises, send status code as a last-ditch response.
|
48
|
+
def failsafe_response(fallback_output, status, originating_exception = nil)
|
49
|
+
yield
|
50
|
+
rescue Exception => exception
|
51
|
+
begin
|
52
|
+
log_failsafe_exception(status, originating_exception || exception)
|
53
|
+
body = failsafe_response_body(status)
|
54
|
+
fallback_output.write "Status: #{status}\r\nContent-Type: text/html\r\n\r\n#{body}"
|
55
|
+
nil
|
56
|
+
rescue Exception => failsafe_error # Logger or IO errors
|
57
|
+
$stderr.puts "Error during failsafe response: #{failsafe_error}"
|
58
|
+
$stderr.puts "(originally #{originating_exception})" if originating_exception
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
def failsafe_response_body(status)
|
64
|
+
error_path = "#{error_file_path}/#{status.to_s[0..3]}.html"
|
65
|
+
|
66
|
+
if File.exist?(error_path)
|
67
|
+
File.read(error_path)
|
68
|
+
else
|
69
|
+
"<html><body><h1>#{status}</h1></body></html>"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def log_failsafe_exception(status, exception)
|
74
|
+
message = "/!\\ FAILSAFE /!\\ #{Time.now}\n Status: #{status}\n"
|
75
|
+
message << " #{exception}\n #{exception.backtrace.join("\n ")}" if exception
|
76
|
+
failsafe_logger.fatal message
|
77
|
+
end
|
78
|
+
|
79
|
+
def failsafe_logger
|
80
|
+
if defined?(::RAILS_DEFAULT_LOGGER) && !::RAILS_DEFAULT_LOGGER.nil?
|
81
|
+
::RAILS_DEFAULT_LOGGER
|
82
|
+
else
|
83
|
+
Logger.new($stderr)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
cattr_accessor :error_file_path
|
89
|
+
self.error_file_path = "#{::RAILS_ROOT}/public" if defined? ::RAILS_ROOT
|
90
|
+
|
91
|
+
cattr_accessor :callbacks
|
92
|
+
self.callbacks = Hash.new { |h, k| h[k] = [] }
|
93
|
+
|
94
|
+
cattr_accessor :unprepared
|
95
|
+
self.unprepared = true
|
96
|
+
|
97
|
+
|
98
|
+
before_dispatch :reload_application
|
99
|
+
before_dispatch :prepare_application
|
100
|
+
after_dispatch :flush_logger
|
101
|
+
after_dispatch :cleanup_application
|
102
|
+
|
103
|
+
if defined? ActiveRecord
|
104
|
+
to_prepare :activerecord_instantiate_observers do
|
105
|
+
ActiveRecord::Base.instantiate_observers
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def initialize(output, request = nil, response = nil)
|
110
|
+
@output, @request, @response = output, request, response
|
111
|
+
end
|
112
|
+
|
113
|
+
def dispatch
|
114
|
+
run_callbacks :before
|
115
|
+
handle_request
|
116
|
+
rescue Exception => exception
|
117
|
+
failsafe_rescue exception
|
118
|
+
ensure
|
119
|
+
run_callbacks :after, :reverse_each
|
120
|
+
end
|
121
|
+
|
122
|
+
def dispatch_cgi(cgi, session_options)
|
123
|
+
if cgi ||= self.class.failsafe_response(@output, '400 Bad Request') { CGI.new }
|
124
|
+
@request = CgiRequest.new(cgi, session_options)
|
125
|
+
@response = CgiResponse.new(cgi)
|
126
|
+
dispatch
|
127
|
+
end
|
128
|
+
rescue Exception => exception
|
129
|
+
failsafe_rescue exception
|
130
|
+
end
|
131
|
+
|
132
|
+
def reload_application
|
133
|
+
if Dependencies.load?
|
134
|
+
Routing::Routes.reload
|
135
|
+
self.unprepared = true
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def prepare_application(force = false)
|
140
|
+
begin
|
141
|
+
require_dependency 'application' unless defined?(::ApplicationController)
|
142
|
+
rescue LoadError => error
|
143
|
+
raise unless error.message =~ /application\.rb/
|
144
|
+
end
|
145
|
+
|
146
|
+
ActiveRecord::Base.verify_active_connections! if defined?(ActiveRecord)
|
147
|
+
|
148
|
+
if unprepared || force
|
149
|
+
run_callbacks :prepare
|
150
|
+
self.unprepared = false
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Cleanup the application by clearing out loaded classes so they can
|
155
|
+
# be reloaded on the next request without restarting the server.
|
156
|
+
def cleanup_application(force = false)
|
157
|
+
if Dependencies.load? || force
|
158
|
+
ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
|
159
|
+
Dependencies.clear
|
160
|
+
ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def flush_logger
|
165
|
+
RAILS_DEFAULT_LOGGER.flush if defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:flush)
|
166
|
+
end
|
167
|
+
|
168
|
+
protected
|
169
|
+
def handle_request
|
170
|
+
@controller = Routing::Routes.recognize(@request)
|
171
|
+
@controller.process(@request, @response).out(@output)
|
172
|
+
end
|
173
|
+
|
174
|
+
def run_callbacks(kind, enumerator = :each)
|
175
|
+
callbacks[kind].send!(enumerator) do |callback|
|
176
|
+
case callback
|
177
|
+
when Proc; callback.call(self)
|
178
|
+
when String, Symbol; send!(callback)
|
179
|
+
when Array; callback[1].call(self)
|
180
|
+
else raise ArgumentError, "Unrecognized callback #{callback.inspect}"
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
def failsafe_rescue(exception)
|
186
|
+
self.class.failsafe_response(@output, '500 Internal Server Error', exception) do
|
187
|
+
if @controller ||= defined?(::ApplicationController) ? ::ApplicationController : Base
|
188
|
+
@controller.process_with_exception(@request, @response, exception).out(@output)
|
189
|
+
else
|
190
|
+
raise exception
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module ActionController #:nodoc:
|
2
2
|
module Filters #:nodoc:
|
3
3
|
def self.included(base)
|
4
|
-
base.
|
5
|
-
|
4
|
+
base.class_eval do
|
5
|
+
extend ClassMethods
|
6
|
+
include ActionController::Filters::InstanceMethods
|
7
|
+
end
|
6
8
|
end
|
7
9
|
|
8
|
-
# Filters enable controllers to run shared pre and post
|
10
|
+
# Filters enable controllers to run shared pre- and post-processing code for its actions. These filters can be used to do
|
9
11
|
# authentication, caching, or auditing before the intended action is performed. Or to do localization or output
|
10
12
|
# compression after the action has been performed. Filters have access to the request, response, and all the instance
|
11
13
|
# variables set by other filters in the chain or by the action (in the case of after filters).
|
@@ -34,7 +36,7 @@ module ActionController #:nodoc:
|
|
34
36
|
# end
|
35
37
|
#
|
36
38
|
# Now any actions performed on the BankController will have the audit method called before. On the VaultController,
|
37
|
-
# first the audit method is called, then the verify_credentials method. If the audit method
|
39
|
+
# first the audit method is called, then the verify_credentials method. If the audit method renders or redirects, then
|
38
40
|
# verify_credentials and the intended action are never called.
|
39
41
|
#
|
40
42
|
# == Filter types
|
@@ -63,7 +65,7 @@ module ActionController #:nodoc:
|
|
63
65
|
# Or just as a quick test. It works like this:
|
64
66
|
#
|
65
67
|
# class WeblogController < ActionController::Base
|
66
|
-
# before_filter { |controller|
|
68
|
+
# before_filter { |controller| head(400) if controller.params["stop_action"] }
|
67
69
|
# end
|
68
70
|
#
|
69
71
|
# As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables.
|
@@ -88,7 +90,7 @@ module ActionController #:nodoc:
|
|
88
90
|
# prepend_before_filter :ensure_items_in_cart, :ensure_items_in_stock
|
89
91
|
#
|
90
92
|
# The filter chain for the CheckoutController is now <tt>:ensure_items_in_cart, :ensure_items_in_stock,</tt>
|
91
|
-
# <tt>:verify_open_shop</tt>. So if either of the ensure filters
|
93
|
+
# <tt>:verify_open_shop</tt>. So if either of the ensure filters renders or redirects, we'll never get around to see if the shop
|
92
94
|
# is open or not.
|
93
95
|
#
|
94
96
|
# You may pass multiple filter arguments of each type as well as a filter block.
|
@@ -140,23 +142,20 @@ module ActionController #:nodoc:
|
|
140
142
|
# around_filter Authorizer.new
|
141
143
|
#
|
142
144
|
# class Authorizer
|
143
|
-
# # This will run before the action.
|
145
|
+
# # This will run before the action. Redirecting aborts the action.
|
144
146
|
# def before(controller)
|
145
|
-
#
|
146
|
-
#
|
147
|
-
# else
|
148
|
-
# redirect_to login_url
|
149
|
-
# return false
|
147
|
+
# unless user.authorized?
|
148
|
+
# redirect_to(login_url)
|
150
149
|
# end
|
151
150
|
# end
|
152
151
|
#
|
153
|
-
# # This will run after the action if and only if before
|
152
|
+
# # This will run after the action if and only if before did not render or redirect.
|
154
153
|
# def after(controller)
|
155
154
|
# end
|
156
155
|
# end
|
157
156
|
#
|
158
157
|
# If the filter has before and after methods, the before method will be
|
159
|
-
# called before the action. If before
|
158
|
+
# called before the action. If before renders or redirects, the filter chain is
|
160
159
|
# halted and after will not be run. See Filter Chain Halting below for
|
161
160
|
# an example.
|
162
161
|
#
|
@@ -216,8 +215,8 @@ module ActionController #:nodoc:
|
|
216
215
|
# <tt>before_filter</tt> and <tt>around_filter</tt> may halt the request
|
217
216
|
# before a controller action is run. This is useful, for example, to deny
|
218
217
|
# access to unauthenticated users or to redirect from http to https.
|
219
|
-
# Simply
|
220
|
-
#
|
218
|
+
# Simply call render or redirect. After filters will not be executed if the filter
|
219
|
+
# chain is halted.
|
221
220
|
#
|
222
221
|
# Around filters halt the request unless the action block is called.
|
223
222
|
# Given these filters
|
@@ -242,9 +241,9 @@ module ActionController #:nodoc:
|
|
242
241
|
# #after (actual filter code is run, unless the around filter does not yield)
|
243
242
|
#
|
244
243
|
# If #around returns before yielding, #after will still not be run. The #before
|
245
|
-
# filter and controller action will not be run. If #before
|
244
|
+
# filter and controller action will not be run. If #before renders or redirects,
|
246
245
|
# the second half of #around and will still run but #after and the
|
247
|
-
# action will not. If #around
|
246
|
+
# action will not. If #around fails to yield, #after will not be run.
|
248
247
|
module ClassMethods
|
249
248
|
# The passed <tt>filters</tt> will be appended to the filter_chain and
|
250
249
|
# will execute before the action on this controller is performed.
|
@@ -439,8 +438,9 @@ module ActionController #:nodoc:
|
|
439
438
|
|
440
439
|
def run(controller)
|
441
440
|
# only filters returning false are halted.
|
442
|
-
|
443
|
-
|
441
|
+
@filter.call(controller)
|
442
|
+
if controller.send!(:performed?)
|
443
|
+
controller.send!(:halt_filter_chain, @filter, :rendered_or_redirected)
|
444
444
|
end
|
445
445
|
end
|
446
446
|
|
@@ -466,7 +466,7 @@ module ActionController #:nodoc:
|
|
466
466
|
|
467
467
|
class SymbolFilter < Filter #:nodoc:
|
468
468
|
def call(controller, &block)
|
469
|
-
controller.send(@filter, &block)
|
469
|
+
controller.send!(@filter, &block)
|
470
470
|
end
|
471
471
|
end
|
472
472
|
|
@@ -601,7 +601,7 @@ module ActionController #:nodoc:
|
|
601
601
|
|
602
602
|
def extract_conditions(*filters, &block) #:nodoc:
|
603
603
|
filters.flatten!
|
604
|
-
conditions = filters.
|
604
|
+
conditions = filters.extract_options!
|
605
605
|
filters << block if block_given?
|
606
606
|
return filters, conditions
|
607
607
|
end
|
@@ -655,8 +655,10 @@ module ActionController #:nodoc:
|
|
655
655
|
def proxy_before_and_after_filter(filter) #:nodoc:
|
656
656
|
return filter unless filter_responds_to_before_and_after(filter)
|
657
657
|
Proc.new do |controller, action|
|
658
|
-
|
659
|
-
|
658
|
+
filter.before(controller)
|
659
|
+
|
660
|
+
if controller.send!(:performed?)
|
661
|
+
controller.send!(:halt_filter_chain, filter, :rendered_or_redirected)
|
660
662
|
else
|
661
663
|
begin
|
662
664
|
action.call
|
@@ -673,7 +675,6 @@ module ActionController #:nodoc:
|
|
673
675
|
base.class_eval do
|
674
676
|
alias_method_chain :perform_action, :filters
|
675
677
|
alias_method_chain :process, :filters
|
676
|
-
alias_method_chain :process_cleanup, :filters
|
677
678
|
end
|
678
679
|
end
|
679
680
|
|
@@ -709,6 +710,7 @@ module ActionController #:nodoc:
|
|
709
710
|
while chain[index]
|
710
711
|
filter, index = skip_excluded_filters(chain, index)
|
711
712
|
break unless filter # end of call chain reached
|
713
|
+
|
712
714
|
case filter.type
|
713
715
|
when :before
|
714
716
|
filter.run(self) # invoke before filter
|
@@ -716,25 +718,31 @@ module ActionController #:nodoc:
|
|
716
718
|
break if @before_filter_chain_aborted
|
717
719
|
when :around
|
718
720
|
yielded = false
|
721
|
+
|
719
722
|
filter.call(self) do
|
720
723
|
yielded = true
|
721
724
|
# all remaining before and around filters will be run in this call
|
722
725
|
index = call_filters(chain, index.next, nesting.next)
|
723
726
|
end
|
727
|
+
|
724
728
|
halt_filter_chain(filter, :did_not_yield) unless yielded
|
729
|
+
|
725
730
|
break
|
726
731
|
else
|
727
732
|
break # no before or around filters left
|
728
733
|
end
|
729
734
|
end
|
735
|
+
|
730
736
|
index
|
731
737
|
end
|
732
738
|
|
733
739
|
def run_after_filters(chain, index)
|
734
740
|
seen_after_filter = false
|
741
|
+
|
735
742
|
while chain[index]
|
736
743
|
filter, index = skip_excluded_filters(chain, index)
|
737
744
|
break unless filter # end of call chain reached
|
745
|
+
|
738
746
|
case filter.type
|
739
747
|
when :after
|
740
748
|
seen_after_filter = true
|
@@ -743,23 +751,16 @@ module ActionController #:nodoc:
|
|
743
751
|
# implementation error or someone has mucked with the filter chain
|
744
752
|
raise ActionControllerError, "filter #{filter.inspect} was in the wrong place!" if seen_after_filter
|
745
753
|
end
|
754
|
+
|
746
755
|
index = index.next
|
747
756
|
end
|
757
|
+
|
748
758
|
index.next
|
749
759
|
end
|
750
760
|
|
751
761
|
def halt_filter_chain(filter, reason)
|
752
762
|
@before_filter_chain_aborted = true
|
753
763
|
logger.info "Filter chain halted as [#{filter.inspect}] #{reason}." if logger
|
754
|
-
false
|
755
|
-
end
|
756
|
-
|
757
|
-
def process_cleanup_with_filters
|
758
|
-
if @before_filter_chain_aborted
|
759
|
-
close_session
|
760
|
-
else
|
761
|
-
process_cleanup_without_filters
|
762
|
-
end
|
763
764
|
end
|
764
765
|
end
|
765
766
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module ActionController #:nodoc:
|
2
2
|
# The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed
|
3
|
-
# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create
|
4
|
-
# that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can
|
5
|
-
# the flash to its template. Actually, that exposure is automatically done. Example:
|
3
|
+
# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create
|
4
|
+
# action that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can
|
5
|
+
# then expose the flash to its template. Actually, that exposure is automatically done. Example:
|
6
6
|
#
|
7
7
|
# class WeblogController < ActionController::Base
|
8
8
|
# def create
|
@@ -16,18 +16,17 @@ module ActionController #:nodoc:
|
|
16
16
|
# end
|
17
17
|
# end
|
18
18
|
#
|
19
|
-
# display.
|
19
|
+
# display.erb
|
20
20
|
# <% if flash[:notice] %><div class="notice"><%= flash[:notice] %></div><% end %>
|
21
21
|
#
|
22
|
-
# This example just places a string in the flash, but you can put any object in there. And of course, you can put as
|
23
|
-
# as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
|
22
|
+
# This example just places a string in the flash, but you can put any object in there. And of course, you can put as
|
23
|
+
# many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
|
24
24
|
#
|
25
25
|
# See docs on the FlashHash class for more details about the flash.
|
26
26
|
module Flash
|
27
27
|
def self.included(base)
|
28
|
-
base.send :include, InstanceMethods
|
29
|
-
|
30
28
|
base.class_eval do
|
29
|
+
include InstanceMethods
|
31
30
|
alias_method_chain :assign_shortcuts, :flash
|
32
31
|
alias_method_chain :process_cleanup, :flash
|
33
32
|
alias_method_chain :reset_session, :flash
|
@@ -63,7 +62,7 @@ module ActionController #:nodoc:
|
|
63
62
|
end
|
64
63
|
|
65
64
|
def update(h) #:nodoc:
|
66
|
-
h.keys.each{ |k|
|
65
|
+
h.keys.each { |k| keep(k) }
|
67
66
|
super
|
68
67
|
end
|
69
68
|
|
@@ -85,7 +84,7 @@ module ActionController #:nodoc:
|
|
85
84
|
#
|
86
85
|
# Entries set via <tt>now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>.
|
87
86
|
def now
|
88
|
-
FlashNow.new
|
87
|
+
FlashNow.new(self)
|
89
88
|
end
|
90
89
|
|
91
90
|
# Keeps either the entire current flash or a specific flash entry available for the next action:
|
@@ -96,10 +95,10 @@ module ActionController #:nodoc:
|
|
96
95
|
use(k, false)
|
97
96
|
end
|
98
97
|
|
99
|
-
# Marks the entire flash or a single flash entry to be discarded by the end of the current action
|
98
|
+
# Marks the entire flash or a single flash entry to be discarded by the end of the current action:
|
100
99
|
#
|
101
|
-
# flash.
|
102
|
-
# flash.discard(:warning) # discard the "warning" entry
|
100
|
+
# flash.discard # discard the entire flash at the end of the current action
|
101
|
+
# flash.discard(:warning) # discard only the "warning" entry at the end of the current action
|
103
102
|
def discard(k = nil)
|
104
103
|
use(k)
|
105
104
|
end
|
@@ -117,7 +116,8 @@ module ActionController #:nodoc:
|
|
117
116
|
end
|
118
117
|
end
|
119
118
|
|
120
|
-
|
119
|
+
# clean up after keys that could have been left over by calling reject! or shift on the flash
|
120
|
+
(@used.keys - keys).each{ |k| @used.delete(k) }
|
121
121
|
end
|
122
122
|
|
123
123
|
private
|
@@ -130,29 +130,19 @@ module ActionController #:nodoc:
|
|
130
130
|
unless k.nil?
|
131
131
|
@used[k] = v
|
132
132
|
else
|
133
|
-
keys.each{|key| use
|
133
|
+
keys.each{ |key| use(key, v) }
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
138
|
module InstanceMethods #:nodoc:
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
flash.sweep if @_session
|
146
|
-
process_cleanup_without_flash
|
147
|
-
end
|
148
|
-
|
149
|
-
def reset_session_with_flash
|
150
|
-
reset_session_without_flash
|
151
|
-
remove_instance_variable(:@_flash)
|
152
|
-
flash(:refresh)
|
153
|
-
end
|
139
|
+
protected
|
140
|
+
def reset_session_with_flash
|
141
|
+
reset_session_without_flash
|
142
|
+
remove_instance_variable(:@_flash)
|
143
|
+
flash(:refresh)
|
144
|
+
end
|
154
145
|
|
155
|
-
protected
|
156
146
|
# Access the contents of the flash. Use <tt>flash["notice"]</tt> to read a notice you put there or
|
157
147
|
# <tt>flash["notice"] = "hello"</tt> to put a new one.
|
158
148
|
# Note that if sessions are disabled only flash.now will work.
|
@@ -172,10 +162,15 @@ module ActionController #:nodoc:
|
|
172
162
|
@_flash
|
173
163
|
end
|
174
164
|
|
175
|
-
|
176
|
-
def
|
177
|
-
|
178
|
-
flash
|
165
|
+
private
|
166
|
+
def assign_shortcuts_with_flash(request, response) #:nodoc:
|
167
|
+
assign_shortcuts_without_flash(request, response)
|
168
|
+
flash(:refresh)
|
169
|
+
end
|
170
|
+
|
171
|
+
def process_cleanup_with_flash
|
172
|
+
flash.sweep if @_session
|
173
|
+
process_cleanup_without_flash
|
179
174
|
end
|
180
175
|
end
|
181
176
|
end
|