This is similiar to Trying to extend ActionView::Helpers::FormBuilder but I don't want to use :builder => MyThing.
I want to extend form builder to add custom methods. This is the current situation:
module ActsAsTreeHelpers
def acts_as_tree_block(method, &block)
yield if block_given?
end
end
ActionView::Helpers::FormBuilder.send :include, ::ActsAsTreeHelpers
Console:
ruby-1.9.2-p180 :004 > ActionView::Helpers::FormBuilder.included_modules
=> [ActsAsTreeHelpers, ...]
But the following gives me: undefined method acts_as_tree_block for #<ActionView::Helpers::FormBuilder:0xae114dc>
<%= form_for thing do |form| %>
<%= form.acts_as_tree_block :parent_id, {"test"} %>
<% end %>
What am I missing here?