The Making of That Nutty Guy: Page Layout
Complete Rails Application Development Tutorial Series
Key Technologies Covered
Ruby on Rails 6
Modern web framework with MVC architecture and convention over configuration approach. Learn model-view-controller patterns and Rails conventions.
Bootstrap 4 with Webpacker
Modern CSS framework integration using Webpacker and Yarn for professional responsive design and component styling.
Database Management
Database migrations, model creation, seeding data, and working with Active Record for data persistence and relationships.
Tutorial Learning Path
Foundation Setup
Create Rails application structure and establish basic configuration for the That Nutty Guy ecommerce site
Model-View-Controller
Build Product model with database migrations, create controllers with actions, and set up view templates
Design Integration
Convert static HTML designs into Rails application layout with proper templating and asset management
Asset Management
Resolve missing images, fonts, and styling issues by properly organizing assets in Rails directory structure
This exercise series provides a comprehensive refresher of Rails fundamentals while introducing modern tools like Webpacker and Bootstrap 4 integration, building upon concepts from earlier coursework.
Environment Setup Requirements
Review the designer's homepage and product detail templates before development
Use drag-and-drop method to ensure correct file path configuration
Initialize complete Rails directory structure and default configuration files
Establish development environment for efficient file management and editing
Product Model Architecture
Database Fields
Five core attributes: title, sku, description, specs, and price with proper data types including decimal precision configuration.
Migration Setup
Custom migration with price precision of 8 digits total and 2 decimal places to handle currency values correctly.
Sample Data
Seeds file containing eight pre-configured products to populate the development database for testing and demonstration.
Controller and Routing Configuration
Generate Controller
Create products controller with plural naming convention following Rails standards
Configure Routes
Set up resources for products with index and show actions, establish root route to products index
Controller Actions
Implement index action with Product.all and show action with Product.find using params[:id]
View Templates
Create index.html.erb and show.html.erb files with proper naming and location in views/products directory
Rails uses a templating approach where individual views represent page-specific content while the application layout contains fixed elements like headers, footers, and navigation that don't change across pages.
Bootstrap 4 Integration Process
Yarn Package Management
Install Bootstrap 4.3.1, jQuery, and Popper.js dependencies using Yarn for modern JavaScript package management in Rails 6.
Webpacker Configuration
Configure application.js with proper require statements and import Bootstrap styles through SCSS preprocessing for optimal loading.
Asset Pipeline Setup
Copy designer's CSS files to Rails assets directory and configure application.css to properly require normalize.min and other stylesheets.
Asset Resolution Process
Image Assets
Copy img folder from HTML snippets to Rails public directory for root-level access
Font Integration
Copy fonts folder to public directory and update CSS path references for proper font loading
CSS Path Correction
Replace relative path references (../) with root references (/) using find and replace - 12 total replacements needed
Files in the public folder are served at the root of the site, so the img folder becomes accessible at localhost:3000/img. This is why relative path references need to be updated to absolute paths.
Key Takeaways