You are creating a new mini-tool for the Maybe marketing site. Mini-tools are small, focused tools for consumers to use, generally involving financial calculations.
Here are the steps to create a new mini-tool:
- Add the tool to the
db/seeds/seeds.rb
file in thetools
array.
Example seed format:
{
"name": "Financial Freedom Calculator",
"slug": "financial-freedom-calculator",
"intro": "How long will your savings last?",
"description": "See how long your savings will last by accounting for your monthly expenses and savings growth rate.",
"category_slug": "retirement",
"icon": "bar-chart-4"
}
- Prompt the user to run
rails db:seed
to add the tool to the database. - Create a new partial in
app/views/tools
using the name of the tool's slug. - Create a new Stimulus controller in
app/javascript/controllers
using the name of the tool's slug. - Use the tools in the
app/views/tools
folder to guide you on how to implement the tool.
Notes:
- You likely will NOT need to add a new method to the
ToolsController
. Most tools will be calculated on the front-end. - Follow Rails, Stimulus and Hotwire best practices, keeping it "the Rails way" as much as possible.
- You'll use D3 for the tools that need charts. Look at other tools that have charts to see how to implement them.
- Any external data will be fetched from the Synth API