Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created August 24, 2008 21:51
Show Gist options
  • Save carllerche/7009 to your computer and use it in GitHub Desktop.
Save carllerche/7009 to your computer and use it in GitHub Desktop.
class MyBuilder < Merb::Helpers::Form::Builder::Base
def my_awesome_method
end
end
class AnotherBuilder < Merb::Helpers::Form::Builder::Base
def another_method
end
end
# --- To get it to work, I have to define the following helpers ---
def my_awesome_method
current_form_context.my_awesome_method
end
def another_method
current_form_context.another_method
end
<%= form_for :something, :builder => MyBuilder do %>
<%= my_awesome_method %>
<% end =%>
<%= form_for :another, :builder => AnotherBuilder do %>
<%= another_method %>
<% end =%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment