Okay scratch that idea. I was trying to create my own abstracted form
helpers and realized that someone had already done a better job in
plugin form:

http://cssformbuilder.rubyforge.org/wiki/wiki.pl

There is only one problem here and that is with the textarea tag. As
we know, Haml's indentation affects this tag contents unless we
explicitly set it as:

~ textarea :description

This means that I have to somehow integrate that tilde function into
the plugin. Here is the code that builds the HTML:

def process(field,options,tag_output)
  unless (extra=options[:extra]).nil?
    tag_extra="<span style='float:left'>#{extra}</span>"
  else
    tag_extra=""
  end if
  input_field_id = "[EMAIL PROTECTED]"
  label=options[:label]
  label= (field.to_s.humanize) if label.nil?
  s="<div class='form-field'>\n"
  s << "  <label for='#{input_field_id}'>#{label.translate}</label>\n"
unless label==false
  s << "  #{tag_output} #{tag_extra}\n"
  s << "</div>\n"
  s
end

Now, I'm not even gonna try to use the :open helpers here because I
know it will just be the same problem. Basically I just have 2
questions

1. How does one get a method inside of a plugin to speak Haml?
2. What is the best way to code this so that only textarea gets the
tilde treatment?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to