0
@@ -9,42 +9,24 @@ rescue LoadError
0
if action_view_included
0
- class ActionView::Base
0
- alias_method :old_concat, :concat unless instance_methods.include? "old_concat"
0
- alias_method :old_form_tag, :form_tag unless instance_methods.include? "old_form_tag"
0
- alias_method :old_form_for, :form_for unless instance_methods.include? "old_form_for"
0
+ # This overrides various helpers in ActionView
0
+ # to make them work more effectively with Haml.
0
- # This module overrides various helpers in ActionView
0
- # to make them work more effectively with Haml.
0
- # It also defines several helper methods,
0
- # available from a Haml template,
0
- # which are only useful within the context of ActionView.
0
- # It's not available unless ActionView is installed.
0
- # Methods in this module should be nodoc'd.
0
- def self.included(othermod) # :nodoc:
0
- othermod.class_eval do
0
- alias_method :capture_erb_with_buffer, :capture_haml_with_buffer
0
- def concat(string, binding = nil) # :nodoc:
0
+ def concat_with_haml(string, binding = nil)
0
buffer.buffer.concat(string)
0
-
old_concat(string, binding)
0
+
concat_without_haml(string, binding)
0
- def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &proc) # :nodoc:
0
+ alias_method_chain :concat, :haml
0
+ def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
0
if block_given? && is_haml?
0
proc = bind_proc do |*args|
0
@@ -54,29 +36,33 @@ if action_view_included
0
- res =
old_form_tag(url_for_options, options, *parameters_for_url, &proc) + "\n"
0
+ res =
form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc) + "\n"
0
concat "\n" if block_given? && is_haml?
0
- def form_for(object_name, *args, &proc) # :nodoc:
0
+ alias_method_chain :form_tag, :haml
0
+ def form_for_with_haml(object_name, *args, &proc)
0
if block_given? && is_haml?
0
proc = bind_proc do |*args|
0
-
old_form_for(object_name, *args, &proc)
0
+
form_for_without_haml(object_name, *args, &proc)
0
concat "\n" if block_given? && is_haml?
0
- def generate_content_class_names
0
- controller.controller_name + " " + controller.action_name
0
+ alias_method_chain :form_for, :haml
0
+ def generate_content_class_names
0
+ controller.controller_name + " " + controller.action_name
Comments
No one has commented yet.