Code Monkey home page Code Monkey logo

rails-mvc-structure-readme's Introduction

The Rails File Structure

You should be relatively familiar with the Rails file structure having basically built a version of Rails using Sinatra. Below is the standard file structure of a Rails 4.2 app, which is automatically generated when you generate a new rails app with rails new. Look for comments explaining some new directories and files you may not be familiar with.

app_name/
├── app
│   ├── assets # For js and css that you've written
│   │   ├── images
│   │   ├── javascripts
│   │   │   └── application.js # A manifest file for the asset pipeline
│   │   └── stylesheets
│   │       └── application.css # A manifest file for the asset pipeline
│   ├── controllers
│   │   ├── application_controller.rb # From which all controllers inherit from
│   │   └── concerns # For keeping reusable code that applies to all controllers
│   ├── helpers # For view helper modules
│   │   └── application_helper.rb 
│   ├── mailers # For code pertaining to sending emails
│   ├── models
│   │   └── concerns # For keeping reusable code that applies to all models
│   └── views
│       └── layouts
│           └── application.html.erb # For HTML that will be on all web pages. <head> tag for example
├── bin # Rails command line tools; we have a few extras with flatiron-rails
│   ├── bundle
│   ├── rails
│   ├── rake
│   ├── setup
│   └── spring
├── config # Configuration code
│   ├── application.rb # Loads rails gems, gems for the specified Rail.env, and configures the application
│   ├── boot.rb # Sets up Bundler and load paths
│   ├── database.yml # Database configuration
│   ├── environment.rb # Runs all initializers
│   ├── environments # Settings for specific environments, production, testing, development, etc. 
│   │   ├── development.rb
│   │   ├── production.rb
│   │   └── test.rb
│   ├── initializers # These configuration files load after the framework and gems
│   │   ├── assets.rb
│   │   ├── backtrace_silencers.rb
│   │   ├── cookies_serializer.rb
│   │   ├── filter_parameter_logging.rb
│   │   ├── inflections.rb
│   │   ├── mime_types.rb
│   │   ├── session_store.rb
│   │   └── wrap_parameters.rb
│   ├── locales # For language/international configuration. If you want your app in multiple languages!
│   │   └── en.yml # English localization file
│   ├── routes.rb # Where we build our routes for requests to our app
│   └── secrets.yml # Rails' built in secret key management
├── config.ru # For Rack-based servers to start the application
├── db # database files. Migrations, seed files, etc.
│   └── seeds.rb
├── lib # External libraries go here
│   ├── assets
│   └── tasks
├── log # Error logs live here
├── public # files for the web server that don't change. Static web pages.
│   ├── 404.html
│   ├── 422.html
│   ├── 500.html
│   ├── favicon.ico
│   └── robots.txt
├── spec # all tests
│   ├── feature_helper.rb
│   ├── features
│   ├── rails_helper.rb # As of RSpec 3.x this replaces spec_helper
│   └── spec_helper.rb
├── tmp # Where Rails holds temporary files for immediate processing
│   └── cache
│       └── assets
├── vendor # Where we keep third-party assets (like Bootstrap Themes)
│   └── assets
│       ├── javascripts
│       └── stylesheets
├── Gemfile
├── Gemfile.lock
├── README.rdoc
└── Rakefile

View The Rails File Structure on Learn.co and start learning to code for free.

rails-mvc-structure-readme's People

Contributors

ahimmelstoss avatar arelenglish avatar fs-lms-test-bot avatar sarogers avatar fislabstest avatar

Watchers

Corinna Brock avatar James Cloos avatar Adam Enbar avatar Victoria Thevenot avatar Rebekah Rombom avatar Anisha Ramnani avatar MUA avatar Johnny Trinh avatar  avatar Hope Reagan avatar Liz Burton avatar Sam Nagourney avatar Tony G avatar Nicki Anselmo avatar Esmery Corniel avatar Alex Griffith avatar Lindsey Wells avatar Susan LoVaglio avatar Lore Dirick avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.