Marcel walked in the right direction. But you need to get a valid area for the rendering engine from somewhere. What I did was called an assistant with a valid scope:
In my_view / edit.html.haml
=my_revertable_field(self, 'hello world')
In application_helper.rb
def my_revertable_field(haml_scope, title, field) template =<<EOS .field #{label} = text_field_tag #{field.name}, #{field.amount}, :size=>5, :class=>"text" = image_tag("refreshArrow.gif",:class=>"revert-icon", :style=>"display:none;",:title=>"Revert to default, #{field.default}") EOS end
Then you have a valid haml scope, and so image_tab, form_tag_helpers all work
Rob
source share