Reputation: 11
instead of this
module ActionView
module Helpers
module FormHelper
def text_area_with_wrap(object_name, method, options)
"<span class=\"wrap\">#{text_area_without_wrap(object_name, method, options)}</span>"
end
alias_method_chain :text_area, :wrap
end
end
end
for obvious reasons I would want to do this
module ActionView
module Helpers
module FormHelper
def text_area_with_wrap(*args)
"<span class=\"wrap\">#{text_area_without_wrap(args)}</span>"
end
alias_method_chain :text_area, :wrap
end
end
end
Does any of you know if and how this can be done? Can't find it in the manuals.
Many thanks in advance!
Upvotes: 1
Views: 1315
Reputation: 6868
I think this should work:
module ActionView
module Helpers
module FormHelper
def text_area_with_wrap(*args)
"<span class=\"wrap\">#{text_area_without_wrap(*args)}</span>"
end
alias_method_chain :text_area, :wrap
end
end
end
Note the extra *
.
Upvotes: 3