Practical Web Programming

Friday, January 08, 2016

Creating a Skeleton Rails Application without Database and Test Unit

  1. 1. Create application without database access and test unit
        $ rails new [app_name] --skip-active-record --skip-test-unit
    
  2. Include Bootstrap
    • Download Bootstrap and extract content
    • Copy bootstrap.min.css and bootstrap.css to /app/assets/css folder
    • Copy bootstrap.min.js and bootstrap.js to /app/assets/js folder
    • Copy fonts folder to /app/assets folder
    Note: The reason why I put bootstrap.css in the main root of asset folder is so I can create a file (ex: custom.css) that will over ride the Bootstrap.css rules in case I want to.
  3. Create main controller that will serve as root file.
  4.     $ rails generate controller main_controller index --no-assets --no-helper
    
  5. Set the root route to main_controller#index
        root 'main_controller#index'
    

0 comments:

Recent Post