This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Turn based ruby game | |
=begin | |
GOAL | |
Write a simple game that allows the user and the computer to take turns selecting moves to use against each other. | |
Both the computer and the player should start out at the same amount of health (such as 100), | |
and should be able to choose between the three moves: | |
The first move should do moderate damage and has a small range (such as 18-25). | |
The second move should have a large range of damage | |
and can deal high or low damage (such as 10-35). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Turn based ruby game | |
=begin | |
GOAL | |
Write a simple game that allows the user and the computer to take turns selecting moves to use against each other. | |
Both the computer and the player should start out at the same amount of health (such as 100), | |
and should be able to choose between the three moves: | |
The first move should do moderate damage and has a small range (such as 18-25). | |
The second move should have a large range of damage | |
and can deal high or low damage (such as 10-35). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node | |
attr_accessor :data, :left, :right | |
def initialize(data) | |
@data = data | |
end | |
include Comparable | |
def <=>(node) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
devise_for :users | |
resources :users do | |
resources :images | |
resources :reviews | |
end | |
resources :memberships, only: [:new, :create] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateGyms < ActiveRecord::Migration[5.1] | |
def change | |
create_table :gyms do |t| | |
t.references :users | |
t.references :routes | |
t.string :gym_name, null: false | |
t.text :about | |
t.string :address | |
t.string :email | |
t.timestamps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class DeviseCreateUsers < ActiveRecord::Migration[5.1] | |
def change | |
create_table :users do |t| | |
## Database authenticatable | |
t.string :first_name, null: false | |
t.string :last_name, null: false | |
t.string :user_name, null: false | |
t.string :email, null: false, default: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateComments < ActiveRecord::Migration[5.1] | |
def change | |
create_table :comments do |t| | |
t.references :climbs | |
t.references :users | |
t.text :text | |
t.timestamps | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class DeviseCreateUsers < ActiveRecord::Migration[5.1] | |
def change | |
create_table :users do |t| | |
## Database authenticatable | |
t.string :first_name, null: false | |
t.string :last_name, null: false | |
t.string :user_name, null: false | |
t.string :email, null: false, default: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1> Add a route to this gym <h1> | |
<br> | |
<%= form_for :route, url: { action: "create" }, method: 'post' do |f| %> | |
<div class="field"> | |
<%= f.label :route_identifier %><br> | |
<%= f.text_field :route_identifier %> | |
</div> | |
<div class="field"> | |
<%= f.label :grade %><br> | |
<%= f.text_field :grade %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new | |
@route = Route.new | |
@gym = Gym.find(params[:gym_id]) | |
end | |
def create | |
if current_user.route_setter | |
#binding.pry |