Skip to content

Simplify rendering of file_field for Bootstrap 5 alpha 3 #572

Closed

Description

@thimo

Bootstrap 5 alpha 3 can now render a very nice looking file selector without needing additional classes or extra markup.

Current markup for f.file_field :image:

<div class="mb-3">
  <label class="form-label" for="workout_video_image">Image</label>
  <div class="form-file">
    <input class="form-file-input" type="file" name="workout_video[image]" id="workout_video_image">
    <label class="form-label form-file-label" for="workout_video_image">Choose file</label>
  </div>
</div>

Can be simplified to:

<div class="mb-3">
  <label class="form-label" for="workout_template_image">Image</label>
  <input class="form-control" type="file" name="workout_video[image]" id="workout_video_image">
</div>

More information can be found here: https://v5.getbootstrap.com/docs/5.0/forms/form-control/#file-input

I'd like to try to make this change myself, but if someone else is in a position to pick this up feel free to do so.

Activity

  1. lcreid commented on Jan 14, 2021

    @lcreid
    Contributor

    Nice catch! We'd love to see a PR for this. If you have time to work on it, just assign the issue to yourself (so no one else starts working on it), and have a go. Thanks very much for your contribution.

    (And no worries if you don't find time to do this. We'll get it done eventually.)

  2. thimo commented on Apr 6, 2021

    @thimo
    CollaboratorAuthor

    @lcreid I'd like to (finally) start working on this and assign this issue to myself. But I can't seem to find the option to do so. Any help on how I can do that? Or maybe you can assign it to me? Same for the other issue I created: #573.

  3. assigned and unassigned on Apr 10, 2021
  4. lcreid commented on Apr 10, 2021

    @lcreid
    Contributor

    Hmmm. Maybe you're not allowed to assign yourself. The history of this gem is long, and none of us currently have full permissions on the repo, so maybe we're stuck with people not being able to assign themselves. Thanks for pointing that out.

  5. added a commit that references this issue on Apr 11, 2021
    b0e53cd
  6. added 2 commits that reference this issue on Nov 12, 2021
    13af7bd
    dce8d9f
  7. added a commit that references this issue on Dec 28, 2021
    e45152c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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