Because guidelines are ephemeral, a presenter is used to display initial guidelines that have guideline categories that, in turn, have many articles. Presenters also take care of fetching and rendering metadata stored in YML files
[x] make methods such as GuidelineCategory.extract_slug etc., ~~metadata
file fetching and loading~~(done), and loading dirs via Pathname reusable.
This is because GuidelineCategory and GuidelineArticle will be sharing
90% of their methods. GuidelineArticle will also need to be able to
load its own metadata
[x] move GuidelinesPresenter to app/models since GuidelineCategory
is very similar and acts as a stand-in for a model
Closes #42
This PR handles adding guideline resources are described in #42.
To follow the requested URL structure (comment: https://github.com/panvol/pandemic-volunteers/issues/42#issuecomment-615248137), an default locale of
en
is introduced and used as a scope in routes, to ensure that/en/guidelines
and/guidelines
route default to the same resourceBecause
guidelines
are ephemeral, a presenter is used to display initial guidelines that have guideline categories that, in turn, have many articles. Presenters also take care of fetching and rendering metadata stored in YML filesDimitry's TODO:
GuidelineCategory.extract_slug
etc., ~~metadata file fetching and loading~~(done), and loading dirs viaPathname
reusable. This is because GuidelineCategory and GuidelineArticle will be sharing 90% of their methods. GuidelineArticle will also need to be able to load its own metadataGuidelinesPresenter
toapp/models
sinceGuidelineCategory
is very similar and acts as a stand-in for a modelHan's TODO: