Notes from working with:
https://devmynd.com/blog/2014-7-rails-ember-js-with-the-ember-cli-redux-part-1-the-api-and-cms-with-ruby-on-rails/
- Create new rails app
rails new backend -T -d postgresql cd backend
- Edit Gemfile and be sure the below is included
gem "grape" gem "grape-active_model_serializers" gem "grape-swagger-rails" group :development do gem "better_errors" gem "meta_request" gem "quiet_assets" gem "spring" gem "rails-erd" # Generates a Entity Relationship Diagram end group :development, :test do gem "capybara" gem "capybara-screenshot" gem "database_cleaner" gem "factory_girl_rails" gem "faker" gem "poltergeist" gem "pry-nav" gem "pry-rails" gem "pry-stack_explorer" gem "pry-theme" gem "rspec-rails" gem "rubocop" gem "shoulda-matchers" gem "spring-commands-rspec" gem "annotate" # Annotates model classes with comments of db fields end
- Install the dependencies
bundle install
- Edit credentials for database, config/database.yml
- Run some generators
bundle exec rails generate rspec:install bundle exec spring binstub --all bundle exec rake db:create db:migrate db:seed
-
bundle exec rails generate model contact first_name:string last_name:string email:string title:string
default: &default
adapter: postgresql
....
....
host: localhost
username: pguser
password: test