Skip to main content

How do I add radio buttons to devise signup form ?

General • Asked by Arnas Klasauskas

I'm currently trying to add radio buttons to the devise signup form, the problem is that I dont know how I should write the migration, should it be a boolean, an integer or a string ?

The user can choose between two options, therefore I don't know how to proceed.

This is the current html code:

          <div class="row">
            <div class="col">
              <div class="form-group rounded bg-white p-2 border">
                <div class="custom-control custom-radio">
                  <input type="radio" id="course-radio-beginner-1" name="course-radio-1" class="custom-control-input">
                  <label class="custom-control-label" for="course-radio-beginner-1">Gründer</label>
                </div>
              </div>
            </div>
            <div class="col">
              <div class="form-group rounded bg-white p-2 border">
                <div class="custom-control custom-radio">
                  <input type="radio" id="course-radio-advanced-1" name="course-radio-1" class="custom-control-input">
                  <label class="custom-control-label" for="course-radio-advanced-1">Unternehmen</label>
                </div>
              </div>
            </div>
          </div>

Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 20,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.