rails / tailwindcss-rails

MIT License
1.42k stars 174 forks source link

Checkbox spreads over the entire area #415

Closed enderahmetyurt closed 1 month ago

enderahmetyurt commented 1 month ago

Hey,

I created my projects running rails new my-todo-app --main --css=tailwind and I created a scaffold model rails g scaffold Task title:string description:text completed:boolean due_date:datetime it created a form but checkbox looks weird even this line https://github.com/rails/tailwindcss-rails/blob/main/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt#L31

it generated this code line in _form.html.erb

  <div class="my-5">
    <%= form.label :completed %>
    <%= form.checkbox :completed, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
  </div>

Screenshot 2024-10-08 at 14 04 00

I was expecting it wouldn't be cover all width, but it did.

What should I do?

enderahmetyurt commented 1 month ago

I see the problem :) The form is generating checkedbox but here https://github.com/rails/tailwindcss-rails/blob/main/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt#L31 it's check_box I can fix it