This file contains 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 User < ApplicationRecord | |
has_many :notebooks, dependent: :destroy | |
has_one :user_name, foreign_key: "id", dependent: :destroy | |
# Has an attribute of first_name | |
# As well as an attribute of last_name | |
end | |
class Notebook < ApplicationRecord | |
belongs_to :user, autosave: true | |
has_many :email_logs, as: :email_loggable, dependent: :destroy |
This file contains 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
/* This changes the color of the font on the navbar folder items and removes black border from around the dropdown links for folder links*/ | |
.tweak-header-primary-nav-hover-style-fader .Header-nav .Header-nav-folder { | |
background-color: none; | |
} | |
.Header-nav-folder { | |
border: none; | |
border: 0; | |
} | |
.Header-nav-folder-item { | |
background-color: rgb(237, 125, 12); |
This file contains 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
document.addEventListener("DOMContentLoaded", function(event) { | |
// ID's should be unique | |
// Button to click and execute prompt | |
var my_button = document.getElementById("my_button_id"); | |
// Try adding another element by ID. Such as a div to append the names to | |
// For example: | |
// var my_div = document.getElementById("my_div"); | |
// This is attaching a click event function with the function | |
// buttonAlert to the myButton ID | |
myButton.addEventListener("click", buttonAlert); |
This file contains 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 Squares | |
def initialize(number) | |
@number = number | |
end | |
def square_of_sum | |
(1..@number).to_a.sum ** 2 | |
end | |
def sum_of_squares |
This file contains 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
# First I had this | |
class Series | |
def initialize(numbers) | |
@numbers = numbers | |
@numbers_array = numbers.split("").map { |num_string| num_string.to_i } | |
end | |
def slices(substring_length) | |
substring_length = substring_length.to_int | |
if substring_length > @numbers_array.length |
OlderNewer