Git Product home page Git Product logo

cat-tinder-backend-bobtails's Introduction

README

## JB Comp

$ rails new cat-tinder-backend -d postgresql -T $ cd cat-tinder-backend $ rails db:create $ bundle add rspec-rails $ rails generate rspec:install $ git remote add origin https://github.com/learn-academy-2021-echo/cat-tinder-backend-bobtails.git $ git checkout -b main $ git add . $ git commit -m "initial commit" $ git push origin main $ rails db:create $ bundle add respec-rails $ rails generate rspec:install $ rails server $ rails generate resource Bird name:string age:integer enjoys:text image:text $ rails db:migrate $ rspec spec $ rails routes $ rails server

## Hickey comp

1036 git clone https://github.com/learn-academy-2021-echo/cat-tinder-backend-bobtails.git 1037 cd cat-tinder-backend-bobtails 1039 git checkout -b backend-structure 1040 git branch 1041 git status 1042 code . 1043 rails db:create 1045 rails db:migrate 1046 rspec spec

in seeds.rb

birds = [ { id: 1, name: "Blake", age: 18, enjoys: "late night feather ruffling", image:"https://i.pinimg.com/originals/16/66/51/166651081286be1dd69920c27e89658d.jpg"

}, { id: 2, name: "Aaron", age: 8, enjoys: "having his name pronounced correctly!", image: "https://i.pinimg.com/originals/14/e6/34/14e63434d7adeb7c87c35fb3b7f49d0d.png", }, { id: 3, name: "Bobo", age: 12, enjoys: "staring into your soul", image: "https://www.pinkvilla.com/imageresize/avengers-endgame-star-mark-ruffalo-celebrates-bruce-banners-50th-birthday-with-an-endearing-post.jpg?width=752&format=webp&t=pvorg", }, ];

birds.each do |value| Bird.create value p 'creating the bird attributes ${value}' end

1048 rails db:seed 1049 rails c - pp Bird.all

 # in code editor - application_controller
class ApplicationController < ActionController::Base

skip_before_action :verify_authenticity_token end # in Gemfile gem 'rack-cors', :require => 'rack/cors'

# in config/initializers
  - created file cors.rb
  Rails.application.config.middleware.insert_before 0, Rack::Cors do

allow do origins '*' # <- change this to allow requests from any domain while in development.

resource '*',
  headers: :any,
  methods: [:get, :post, :put, :patch, :delete, :options, :head]

end end

1054 rails c 1055 bundle

cat-tinder-backend-bobtails's People

Contributors

jbudd512 avatar kickeyhickey 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.