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
<%= render file: 'view_directory/file_name'%> |
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
var exclaim = (string) => {return string + "!"} | |
var words = ["let's", "do", "this"] | |
console.log(words.map(exclaim)) |
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
var exclaim = (string) => {return string + "!"} | |
var words = ["let's", "do", "this"] | |
console.log(words.map(exclaim)) | |
//[ 'let\'s!', 'do!', 'this!' ] |
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
$(".title").removeClass("light-blue") |
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
<%= f.collection_check_boxes :program_ids, @programs, :id, :title %> |
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
<%= f.collection_check_boxes(:program_ids, @programs, :id, :title) do |b| %> | |
<div> <%= b.check_box %><%= b.label { b.text } %></div> | |
<% 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
class ClassroomsController < ApplicationController | |
def update | |
@classroom = Classroom.find(params[:id]) | |
if @classroom.update(classroom_params) | |
program_ids = classroom_program_params[:program_ids].delete_if {|program| program == ""} | |
@programs = program_ids.map {|id| Program.find(id)} | |
@classroom.update(programs: @programs) | |
redirect_to users_path, :notice => "#{@classroom.name} updated" | |
else | |
flash[:notice] = "Classrooms must have a name" |
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 ClassroomsController < ApplicationController | |
def update | |
@classroom = Classroom.find(params[:id]) | |
if @classroom.update(classroom_params) | |
redirect_to users_path, :notice => "#{@classroom.name} updated" | |
else | |
flash[:notice] = "Classrooms must have a name" | |
@programs = Program.all | |
render :edit |
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
function eventLoop(){ | |
setTimeout(() => {console.log(3)},0) | |
console.log(1) | |
return 2 | |
} | |
eventLoop() |
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
function concat(first, last){ | |
return `${first} ${last}` | |
} | |
function greet(f, l){ | |
console.log(`Hi, ${concat(f, l)}`) | |
} | |
greet("Gabi", "Granger") |