Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Delete vestigial MailingListForm; use button_to for subscribe/unsubscribe

Đang mở Phù hợp với người mới
#2,948 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rails, ruby
Lĩnh vực
web-dev

Hướng nghiên cứu

Trước tiên, hãy đọc app/views/subscriptions/index.html.haml và app/form_models/mailing_list_form.rb, sau đó kiểm tra phần coverage của trang subscriptions trong spec/features. Xác nhận các route Create và Destroy hiện có cùng các action của MailingListsController trước khi thay đổi view. Công việc được xem là hoàn tất khi cả hai button hoạt động giống nhau, unsubscribe vẫn sử dụng DELETE, form model đã được xóa và các feature spec liên quan đều pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

good first issue tech debt

Problem

app/form_models/mailing_list_form.rb is a one-line ActiveModel::Model class (attr_accessor :name) that exists only as an anchor object for two simple_form_for wrappers in app/views/subscriptions/index.html.haml. Those "forms" are just subscribe/unsubscribe buttons — no fields are rendered, and MailingListsController ignores all params (its create/destroy read nothing). TermsAndConditionsForm stays — it has a real acceptance validation and .valid? gate.

Proposed change

  • Replace both simple_form_for @mailing_list, ... wrappers with button_to (native Rails: handles POST/method: :delete, CSRF, and accepts the same class: 'btn btn-success btn-lg mb-0').
  • Delete app/form_models/mailing_list_form.rb.
  • No controller or route changes.

Acceptance

  • Subscribe/unsubscribe buttons on the subscriptions page behave identically (including method: :delete for unsubscribe).
  • MailingListForm no longer exists.
  • spec/features covering the subscriptions page pass.
Ngôn ngữ chính
Ruby
Star
104
Fork
205
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
81

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codebar/planner

Tất cả issue của codebar/planner

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.