Support for custom form element styles #23

tjogin opened this Issue Jul 3, 2009 · 2 comments


None yet
2 participants

tjogin commented Jul 3, 2009

In order to use pretty iPhone-style checkbox toggles (Look: ), instead of using a plain old boolean_input (which in this case makes an erroneous assumption about how I'd like my label marked up) I had to add this custom input type:

def iphone_toggle_input(method, options)
  html_options = options.delete(:input_html) || {}
  html_options = default_string_options(method).merge(html_options) if STRING_MAPPINGS.include?(type)
  self.label(method, options.slice(:label, :required)) +
  self.send("check_box", method, html_options)

Certainly, that wasn't a big whoop (once I've ironed out the CSS-kinks), but it'd be nice to be able to just "force" the regular "input_simple" style of label markup rather than the one boolean_input now assumes.


justinfrench commented Jul 4, 2009

The whole of Formtastic makes assumptions about how you want your markup -- that's the point really :) Anyway, in Formtastic 2.0, the plan is that you'll be able to override the underlying markup to suit your own preferences.

Right now, we're trying to get a stable and usable 1.0 out the door, which we've consciously decided should not tackle Javascript or custom inputs / markup / styles, so i'll tag this with the 1.x label to revisit after 1.0.


justinfrench commented Jan 9, 2010

Closing, it's not on the radar for now. No matter how much I want it. But I do have a surprise brewing that may solve this another way.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment