Skip to content

Instantly share code, notes, and snippets.

@beck03076
Created September 23, 2013 19:08
Show Gist options
  • Save beck03076/6675336 to your computer and use it in GitHub Desktop.
Save beck03076/6675336 to your computer and use it in GitHub Desktop.
def fset(f,name,elem,mad = nil,label = false)
html = String.new
cl = "frbox "
cl += mad.to_s
html = ("<div class='#{cl}'>" + f.label(name.to_sym,label) + f.send(elem,name.to_sym) + "</div>").html_safe
end
in your view
<div class="col6">
<%= fset(f,"first_name","text_field","mand","First name*") %>
<%= fset(f,"gender","text_field") %>
<%= fset(f,"email1","text_field") %>
<%= fset(f,"mobile1","text_field") %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment