abartov / bybeconv

Project Ben-Yehuda's content management system.
https://benyehuda.org/
Other
10 stars 5 forks source link

Rename ProofController -> ProofsController and refactor it. #287

Closed damisul closed 3 months ago

damisul commented 3 months ago

Currently proof controller is declared in routes as:

get "proof/list"
get "proof/purge" => 'proof#purge', as: 'proof_purge'
match "proof/:id/resolve" => 'proof#resolve', as: 'proof_resolve', via: [:get, :post]

resources :proof

It violates Rails convention, of using plural form for controllers intended to work with entities. So I'd propose to rename it to ProofsController.

And then we can use standard rails actions declared for resources: index instead of list and it will add standardized uri_helpers for them

This is what most rails developer would expected from modern rails app. Also we can consider of moving `shared/_proof' content to proofs#new actions (but this will require to load its content dynamically).

abartov commented 3 months ago

Yes, please do the renaming. This controller is one of the very first ones in the project, back when the texts themselves were static HTML files, and before resource-based routing was introduced, and I never bothered to modernize it.