Updating RailsFast
Updating any template is always going to be a bit difficult, because as you start building your app on top of it many files will diverge from the original template, and conflicts will naturally arise. The worst-case scenario is you need to go file-by-file reviewing the template updates and deciding what to incorporate into your app.
HOWEVER, RailsFast is designed so the amount of effort you need to do is minimized, and ideally you can keep pulling RailsFast improvements into your app without much work.
Make your life easier for updating
As we covered in the Customizing Components section, the best practice if you plan to customize RailsFast components, is that you don’t edit the RailsFast components in-place, instead, copy the component you want to change into your own folder and edit your copy.
Protect your customizations (merge guards)
At some point, you will inevitably edit RailsFast core files. If you did edit files that ship with RailsFast and that you can't copy easily into your own folder (for example, layouts or auth views), you can tell Git to always keep your version on merges by adding merge guards in .gitattributes.
Example:
# Keep my customized files when merging template updates
app/views/devise/** merge=ours
This way, if for example you update all your authentication screens to match your branding and design, when updating RailsFast your files will get priority, overriding the update, and you won't lose your work (you won't get updates on those files, though)
app/views/**, you will also silently skip upstream improvements (including fixes) for those files.How to update RailsFast
Since we configured the remote in the quickstart, we can just pull the latest RailsFast changes:
git fetch railsfast --prune
And then merge them with your project:
git merge railsfast/main
If you get conflicts, resolve them (Git will respect your .gitattributes merge guards), and then commit the merge.
After updating
Run any new migrations:
bin/rails db:migrate
Restart your dev server (bin/dev) and make sure nothing got broken in the update and everything works.