I hereby claim:
- I am kajatiger on github.
- I am kaja (https://keybase.io/kaja) on keybase.
- I have a public key ASAO66UqrqbLKnDk80464wvNiZKKoA9xhrdv9goUn8G-ego
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| class ProductsController < ApplicationController | |
| before_action :set_product, only: [:show, :edit, :update, :destroy] | |
| # GET /products | |
| # GET /products.json | |
| if RAILS_ENV == "development" | |
| def index | |
| if params[:q] | |
| search_term = params[:q] | |
| @products = Product.where("name LIKE ?", "%#{search_term}%") |
| puts "please type rock, scissors or paper" | |
| player = gets.chomp | |
| rand(1..3) | |
| if rand(1..3) == 1 | |
| computer = "rock" | |
| elsif rand(1..3) == 2 |
| class Pet | |
| attr_reader :color, :breed | |
| attr_accessor :name | |
| def initialize(color, breed) | |
| @color = color | |
| @breed = breed | |
| @hungry = true | |
| end |
| class Cat | |
| attr_reader :color, :breed #:name | |
| attr_accessor :name #instead of mentioning the attribute both in reader and writer, we can do both in the same time with accessor | |
| #attr_writer :name | |
| def initialize(color, breed) | |
| @color = color | |
| @breed = breed | |
| @hungry = true | |
| end |
| def fav_foods | |
| food_ary = Array.new | |
| 3.times do | |
| puts "name a favorite food" | |
| food_ary << gets.chomp | |
| food_ary.each do |food| | |
| puts "I like #{food} too!" | |
| end | |
| end | |
| puts "your favorite foods are #{food_ary.join(", ")}." |
| if (5+5==10) | |
| puts "this is true" | |
| else | |
| puts "this is false" | |
| end |
| def greeting | |
| puts "please enter your name" | |
| name = gets.chomp | |
| puts "hello" + " " + name | |
| end | |
| greeting |
| <script src="js/scripts.js"></script> | |
| <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyACgYearY6AZ7p6x5SM2gr6PB2cNkTAOZ4&callback=initMap" | |
| async defer></script> |