Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Delete vestigial MailingListForm; use button_to for subscribe/unsubscribe

未关闭 适合新手
#2,948 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rails, ruby
领域
web-dev

调研方向

先阅读 app/views/subscriptions/index.html.haml 和 app/form_models/mailing_list_form.rb,然后检查 spec/features 下 subscriptions 页面的覆盖情况。在修改视图之前,确认现有的 Create 和 Destroy 路由以及 MailingListsController 的 actions。完成的标准是两个按钮的行为一致,unsubscribe 仍使用 DELETE,表单模型已移除,并且相关的 feature specs 通过。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Ruby
星标
104
派生
205
平均合并
1 天 2 小时
30 天内合并 PR
81

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codebar/planner 的其他 Issue

查看 codebar/planner 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。