Created
August 24, 2008 21:51
-
-
Save carllerche/7009 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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