The agenda for today is as follows:
- Create forms using form_tag.
- Create forms that bind to a rails ActiveModel class
- Create a form that contains a nested form bound to an ActiveModel object
All the examples will be done in class as a live lecture.
def fizzbuzz(start, final) | |
start.upto(final) do |i| | |
puts fizzbrain(i) | |
end | |
end | |
def fizzbrain(num) | |
output = '' | |
output << 'Fizz' if num % 3 == 0 | |
output << 'Buzz' if num % 5 == 0 |
Today we are going to look at some interesting features of the javascript language. Javascript is a prototype-based language with 1st class functions derived from scheme (and self) languages with a C like syntax.
What is a prototype-based language? It is a language of object-oriented programming in which behaviour (think inheritance) is performed by cloning existing objects (i.e. prototypes). It is also an
require_relative 'jsonable' | |
require 'pry-byebug' | |
class Party | |
def self.throw_party(number_of_candles) | |
'We are partying' | |
true | |
end | |
end |