• It contains 3 major parts: ◦ Logic: app/, lib/, & config/ ◦ Tools: Gemfile, Gemfile.lock, Rakefile, config.ru, scripts/, db/ ◦ Testing: spec/, test/, features/ • This is where you run your commands, like `rails` or `rake`
important application logic is at • It normally contains: ◦ controllers/ ◦ models/ ◦ helpers/ ◦ mailers/ ◦ assets/ ◦ views/ • These will be covered in the following classes
of our "setup" code is • It contains things like: ◦ Initializers - Logic that runs at the start of your rails application ◦ Environment logic - Logic that runs depending on your environment type ◦ Settings - Configurations for various external parts of rails, like databases • Changing any of these requires a restart of the application
all place for the rest of your application logic • You can put various changes to Rails in here • These are also loaded at the start of Rails • You probably wont mess with these
of all the gems you'll be using • It also groups the gems into specific environments • It also helps you download the gems you need for your application • The lock file is simply an organized list of dependencies • Don't edit it, it's auto generated
• The `rake -T` command shows you all of the possible tasks • Run: `rake -T` • Important rake tasks are: ◦ rake routes - Shows a list of routes ◦ rake db:migrate - For SQL databases ◦ rake db:create - Mostly for SQL databases
(for sql databases) • This is also where the schema.rb file is kept (for sql databases) • The seed.rb file is also here, and that's where we can build up some data
of custom scripts that do neat things • It's also where the default rails script is • Largely not used, unless you need to do special things for your app
writing checks to make sure your program is working correctly • There are generally two types of testing practices: ◦ Behavior ◦ Unit • There are libraries that have strengths in each: ◦ Rspec is good at behavior testing ◦ Minitest is good at unit testing • We will only cover some basics
• To start your server run: `rails server` • This starts up a local server for your application • You can now access the site at http: //localhost:3000 • No one else can go to this, without you turning some things on • This is the default page of all rails applications