Talk given to introduce the concepts behind rails. Be sure to checkout the sample application that goes with it at: https://github.com/rschmukler/sample_rails
7. Some More Code
#Args
def say_hello_to(name)
puts "Hello #{name}"
end
say_hello_to "The Hub!"
#Blocks
3.times do
puts "Hello again!"
end
["Billy", "Bobby", "Joey"].each do |name|
puts "#{name} go to bed!"
end
a=5
b = 10
sum = a + b
puts sum
8. Classes
class Person
@@default_age = 22
attr_accessable :name, :age
def initialize
@age = @@default_age
end
def favorite_color
@favorite_color
end
def favorite_color=(color)
@favorite_color = color
end
def say_hello
puts "Hello my name is #{@name}"
end
end
9. Gems
• Gems are Ruby’s name for libraries.
• Gem command serves as a package
manager. (eg. gem install rails)
• https://www.ruby-toolbox.com/
10. Ruby on Rails
• One bad ass gem (actually, lots of gems)
• Full stack web application framework
• Convention over configuration (CoC)
• Don’t Repeat Yourself (DRY)
• Built by 37Signals
17. Rails is RESTful
• Coined by Roy T. Fielding in his PhD Thesis
• Read the paper. I over simplify. A LOT.
• REpresentational State Transfer (REST)
• Give Everything IDs
• Standardize
• Stateless communication
18.
19. Rails is Opinionated
• CoffeeScript - “the little language that
compiles into Javascript”
• SASS - CSS, if it didn’t suck.
21. A few shameless plugs...
• GoodMate - got bad roommates? We can
help.
• DreamCloudStudios - Consider hiring me!
Or shoot me an email if you ever need
something!
• Badger Innovations - Student Run Web Dev
Shop. Apply for a job if you like this stuff!
• Know Design? Email me! I will buy you beer.
22. Don’t forget to Vote
• Go vote for a talk you’d like to see. http://
voterapp.herokuapp.com/.You get 2 votes!
• Got an idea for one? Email me and we will
see what we can do.
• I’m here next semester so say Hi