For those looking to dive into creating a Ruby on Rails app, I highly recommend following a tutorial to grasp all the fundamentals.
In a nutshell, here's what you'll need:
- A controller with an action
- A route for your action
- An HTML file with the action's name
- An SCSS file for your stylesheet
Here's a basic example of what your setup could resemble:
config/routes.rb
root :to => "static_pages#home"
app/controller/static_pages_controller.rb
class StaticPagesController < ActionController::Base
def home
end
end
app/views/static_pages/home.html.erb
Hello World
app/views/layout/application.html.erb: Keep the default (it encapsulates your home.html.erb file and incorporates your application stylesheet)
app/assets/stylesheets/application.scss: Import your other stylesheets
//= require home
app/assets/stylesheets/home.scss
Add your custom styles here