Skip to content

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:

  1. Extract File.join(Rails.root, 'doc', file_name) to path_to_doc, so it can be override in JiHu MR.
  2. Remove path_params, I don't see a strong reason to adopt strong params here since strong params is for database.
  3. Refactor redirect_to_documentation_website?.
  4. Refactor render 'show.html.haml'. Rendering template with . is deprecated in Rails, change it to formats: :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.

Edited by Fu Zhang

Merge request reports