Skip to content

Ability to create radio button without label? #161

@akolomiychuk

Description

@akolomiychuk

I want to achieve this html using form_builder

<div class="form-group">
  <label class="sr-only control-label" for="quiz_multiple_question_answer0">Answer0</label>
  <div class="input-group">
    <span class="input-group-addon">A</span>
    <input class="form-control form-control" id="quiz_multiple_question_answer0" name="quiz_multiple_question[answer0]" placeholder="Answer A" type="text">
    <span class="input-group-addon"><input id="quiz_multiple_question_solution_0" name="quiz_multiple_question[solution]" type="radio" value="0"> </span>
  </div>
</div>

with following code

f.text_field("answer#{i}".to_sym, class: 'form-control', placeholder: "Answer #{letters[i]}", hide_label: true, append: f.radio_button(:solution, i), prepend: "#{letters[i]}")

But seems that radio button cannot be created without label. I tested it on version 2.1.1, but seems that this is actual for current master too.

I already monkey-patched it locally(added no_label: true option), so I can create a PR if you approve that this is a feature which you want to have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions