Rails: Using form tags inside lib
Posted
by jaycode
on Stack Overflow
See other posts from Stack Overflow
or by jaycode
Published on 2010-03-17T05:53:03Z
Indexed on
2010/03/17
6:01 UTC
Read the original article
Hit count: 382
So I have this code inside my lib/ folder:
class GlobalConfig::SetHelper
def self.yes_no_input(configuration)
value = configuration.value
name = configuration.name
"#{radio_button_tag name, true, (value == true), {:id => "#{name}_yes"}} #{label_tag "#{name}_yes", 'yes'}
#{radio_button_tag name, false, (value.blank? or value == false), {:id => "#{name}_no"}} #{label_tag "#{name}_no", 'no'}"
end
end
But it returned: undefined method `radio_button_tag' for GlobalConfig::SetHelper:Class when I run the code.
How do I fix this. Anyone?
Thanks
© Stack Overflow or respective owner