Refactor help_controller so that JiHu can customize doc folder
What does this MR do and why?
The location of JiHu documentation is jh/doc
. However, in help_controller
, the path to doc files is hardcoded.
The full JiHu MR is here.
Changes:
- Extract
File.join(Rails.root, 'doc', file_name)
topath_to_doc
, so it can be override in JiHu MR. - Remove
path_params
, I don't see a strong reason to adoptstrong params
here sincestrong params
is for database. - Refactor
redirect_to_documentation_website?
. - Refactor
render 'show.html.haml'
. Rendering template with.
is deprecated in Rails, change it toformats: :html
cc @qianzhangxa
Screenshots or screen recordings
Backend refactor.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Fu Zhang