curi
1
I tried:
module ApplicationHelper
alias_method :orig_text_area, :text_area
def text_area variable, attribute, options={}
options[:cols] ||= 30
options[:rows] ||= 8
orig_text_area(variable, attribute, options)
end
end
But it doesn’t do anything. What’s the correct way?
(And doesn’t answer “CSS”, I still want to know how to do aliases)
curi
2
Elliot T. wrote:
module ActionView
module Helpers
module FormHelper
alias_method :orig_text_area, :text_area
def text_area variable, attribute, options={}
options[:cols] ||= 30
options[:rows] ||= 8
orig_text_area(variable, attribute, options)
end
end
end
end
Kind of off topic but you use CSS do accomplish that same task without
any extra html markup.
curi
3
Elliot T. wrote:
I tried:
module ApplicationHelper
alias_method :orig_text_area, :text_area
def text_area variable, attribute, options={}
options[:cols] ||= 30
options[:rows] ||= 8
orig_text_area(variable, attribute, options)
end
end
But it doesn’t do anything. What’s the correct way?
(And doesn’t answer “CSS”, I still want to know how to do aliases)
I figured it out, I think. I put a file in lib and required it in
environment.rb. it has:
module ActionView
module Helpers
module FormHelper
alias_method :orig_text_area, :text_area
def text_area variable, attribute, options={}
options[:cols] ||= 30
options[:rows] ||= 8
orig_text_area(variable, attribute, options)
end
end
end
end