Sha256: b7daa197cae7da574589ba4b25a3294979866b67f2e37c28e1f5bc684feea3d3

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

// Creates a radio field.
//
// Example:
//
//     {{#radioField field="example"}}
//       <input type="radio" value="one">
//       <input type="radio" value="two">
//       <input type="radio" value="three">
//     {{/radioField}}
//
Handlebars.registerHelper('radioField', function(options) {
  var view = new slices.RadioFieldView({
    id         : slices.fieldId(this, options.hash.field),
    name       : options.hash.field,
    value      : this[options.hash.field],
    inner      : options.fn,
    autoAttach : true
  });

  return new Handlebars.SafeString(view.placeholder());
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slices-2.0.2 app/assets/javascripts/slices/app/helpers/radio_field.js
slices-2.0.1 app/assets/javascripts/slices/app/helpers/radio_field.js
slices-2.0.0 app/assets/javascripts/slices/app/helpers/radio_field.js