1 / 18

URails

URails. Meeting 001. HTTP. Old/Young guys with beards decided “We need to communicate. Let’s use text!” Hypertext Transfer Protocol HTTP is just sending and receiving text from a server You don’t even need a browser, you just need to follow the protocol! (curl example). Client

tuwa
Download Presentation

URails

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. URails Meeting 001

  2. HTTP • Old/Young guys with beards decided “We need to communicate. Let’s use text!” • Hypertext Transfer Protocol • HTTP is just sending and receiving text from a server • You don’t even need a browser, you just need to follow the protocol! (curl example)

  3. Client (Such as a web browser) “Hey, I want to see www.kewl.com” GET / HTTP/1.1 Host: kewl.com Connection: close User-Agent: my-browser Accept-Encoding: gzip Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7 Cache-Control: no-cache <html> This is my Kewl website! </html>  Response HTTP Header ----> Server “Here you go”

  4. What do HTTP servers send back? • HTML? • YES! • Anything it wants? • YES! • Most commonly, HTML is sent for viewing webpages, but other formats are used like XML, JSON, ANY-THING

  5. What is HTML • “Pretty text with formatting” • How does it work?<tag> <- opening tag …content here, including perhaps more tags…</tag> <- closing tag • Hierarchical representation of data (Tree anyone?) • And… that’s it (basically) • Demo time!

  6. It isn’t enough! • Dynamic vs. Static? • What if we want content on a webpage to change without humans editing HTML? • Time Example • What’s happening? • The web server, when it receives a request for a website, replaces “dynamic” content with plain text/html before sending it to the client

  7. Client (Such as a web browser) “Hey, I want to see www.kewl.com” GET / HTTP/1.1 Host: kewl.com Connection: close User-Agent: my-browser Accept-Encoding: gzip Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7 Cache-Control: no-cache <html> This is my Kewl website! 2011-07-14 </html> Server “Here you go” <%= Time.now %> replaced with 2011-07-14

  8. Databases • What are they and why are they important? • They help keep large amounts of data organized, easily accessible, and (hopefully) safe from corruption • We will talk more about Databases in later lectures

  9. Client (Such as a web browser) Receives HTML, and presents it prettily to the user Server Gets data from database, mixes it with HTML, sends it to the client (often referred to as “Business Logic”) Database Safely stores all data related to a website

  10. What types of websites use this model? • Almost all of them (at least any worth using) • Facebook/Engadget/Twitter/Hulu/ESPN/etc. • How do you think Facebooks uses databases?

  11. So Why Ruby on Rails? • The Web is the Wild-Wild-West of programming. It’s a hodge-podge of different technologies that have to work together • What is involved in building a webpage? • HTML • Javascript • CSS • Databases • Security • Managing sessions • Etc… • Bottom line: It can get complicated

  12. So why Ruby on Rails? (cont.) • Ruby is a sweet language (more on that in later lectures) • Rails is a “framework” that provides an excellent way to abstract away and organize the complexity of building dynamic websites • Define “framework”? (this phrase is used a lot in CS) • Let’s see an example! (Get ready for an overload) • After we look at MVC

  13. MVC Client (Such as a web browser) Receives HTML, and presents it prettily to the user (V)iew Server Gets specific data from database, mixes it with HTML, sends it to the client (often referred to as “Business Logic”) (C)ontroller Database (M)odel Safely stores all data related to a website

  14. Thing we’ll be covering • Linux command-line/filesystem • Source Code Version Control (SVN/Git) • HTML/CSS/Javascript • Relational Databases • MVC • HTTP • “Statelessness” of HTTP (sessions, cookies)

  15. What to expect • Rails is command-line intensive (which is good to learn now rather than later) • You will need to run Linux • Options for Windows users • Dual Boot (run both windows and linux and choose which to use when your computer boots) • Run Linux in a Virtual Machine (free software exists for this) • Run Cygwin, which emulates a Linux command-line (similar to a Virtual Machine but less demanding on your computer) • Choose one • Next Lecture: How to install Cygwin/Linux, Ruby, Rails, some command-line practice, and some more Rails in action if we have time.

  16. Why this club will be worth it • Rails is a very valuable/employable skill to have • The world is moving toward the web, so even if you don’t prefer it, you need to know how to get around if you need to • The Rails environment, outside of the web, provides an excellent environment to learn essential skills like getting around at a command-line, version control for source code, and collaborating on non-school projects (rare to find here at the U) • Rails is the cool thing to do.

  17. If we have time… • Where would you like to go from here? • Do people have pet projects they already know they want to work on? • For those that don’t, are you interested in having a “group” project that we work on together, both during meetings and individually? • If not, are there other suggestions?

  18. That’s it! Questions?

More Related