Delete vestigial MailingListForm; use button_to for subscribe/unsubscribe
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先阅读 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 内容生成。
描述
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 withbutton_to(native Rails: handles POST/method: :delete, CSRF, and accepts the sameclass: '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: :deletefor unsubscribe). MailingListFormno longer exists.spec/featurescovering the subscriptions page pass.
- 主要语言
- Ruby
- 星标
- 104
- 派生
- 205
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 81
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codebar/planner 的其他 Issue
-
performance
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
good first issue refactoring tech debt
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
good first issue tech debt
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)未关闭performance
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
data error
难度 2/5 1-3 小时 新手友好度 82/100
riscv/riscv-unified-db#2648 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复