Ruby on Rails CSCI 6314 David Gaspar Jennifer Garcia Avila.

Slides:



Advertisements
Similar presentations
1.  Understanding about How to Working with Server Side Scripting using PHP Framework (CodeIgniter) 2.
Advertisements

Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails Tutorial Peter Mosca April, Ruby on Rails Tutorial Ruby History Invented 12 years ago in Japan by Yukihiro Matsumoto Spent first 5.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Ruby on Rails by Manik Juneja Ruby On Rails. Ruby on Rails by Manik Juneja Rails is a Web Application development framework. Based on the MVC pattern.
Introduction to Backend James Kahng. Install Node.js.
Server-Side vs. Client-Side Scripting Languages
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails a popular web application framework, aimed to increase the speed and ease of web development Ruby on Rails, Tim Zappe.
Multiple Tiers in Action
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Lab 3 Cookie Stealing using XSS Kara James, Chelsea Collins, Trevor Norwood, David Johnson.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
 A cookie is a piece of text that a Web server can store on a user's hard disk.  Cookie data is simply name-value pairs stored on your hard disk by.
Ruby on Rails: An Introduction JA-SIG Summer Conference 2007 Michael Irion The University of Tulsa.
RUBY ON RAILS Mark Zhang. In this talk  Overview of Ruby on Rails  Core ideas  Show a tiny bit of example code  Touch on several general web development/
Ruby on Rails. What is Ruby on Rails? Ruby on Rails is an open source full-stack web framework. It is an alternative to PHP/MySQL. It can render templates,
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
1-Vulnerabilities 2-Hackers 3-Categories of attacks 4-What a malicious hacker do? 5-Security mechanisms 6-HTTP Web Servers 7-Web applications attacks.
Web Application Programming Carol Wolf Computer Science.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
1 Dr Alexiei Dingli Web Science Stream Advanced ROR.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
Lecture 11 Rails Topics SaaSSaaS Readings: SaaS book Ch February CSCE 740 Software Engineering.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
Web Applications Testing By Jamie Rougvie Supported by.
RUBRIC IP1 Ruben Botero Web Design III. The different approaches to accessing data in a database through client-side scripting languages. – On the client.
Model View Controller MVC Web Software Architecture.
RUBY ON RAILS (RoR) Ishwor Khadka. Why Ruby on Rails?
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
IBM Lotus Software © 2006 IBM Corporation IBM Lotus Notes Domino Blog Template Steve Castledine.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
CS 160 and CMPE/SE 131 Software Engineering February 9 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
Basics Components of Web Design & Development Basics, Components, Design and Development.
Web Technology Solutions
What is Laravel ? By Georgi Genov.
Introduction to Dynamic Web Programming
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
PHP / MySQL Introduction
Ruby on Rails by Manik Juneja
Ruby on Rails by Manik Juneja
Web Application Architectures
Web Application Architectures
Security: Exploits & Countermeasures
Security: Exploits & Countermeasures
An Introduction to JavaScript
Security: Exploits & Countermeasures
Web Application Architectures
Security: Attacks & Countermeasures
Presentation transcript:

Ruby on Rails CSCI 6314 David Gaspar Jennifer Garcia Avila

What is Ruby on Rails? Popularly known as “Rails” – open source web application framework “Opinionated” software – makes the assumption that there is the “best” way to do things, and encourages the use of that way Full-stack framework – allows creating pages and apps that gather information from the web server, contact/query the database, and render templates out of the box – Features a routing system that is independent of the web server as a result

How Rails is similar to other frameworks Emphasizes the use of well-known software engineering patterns and principles – Active Record Patter: software architectural program that stores its data in relational databases – Convention over Configuration (CoC): make the code simpler without losing flexibility (decrease # of decisions for developers) – Don’t Repeat Yourself (DRY) principle: reducing repetition of information of all kinds (Single Source of Truth) “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system” (Andy Hunt and Dave Thomas”) – Model-View-Controller (MVC): separates the representation of information from the user’s interaction with it

History of Rails David Heinemeier Hansson released Rails as open source in July 2004 October 2007 – Apple shipped Rails with Mac OS X v10.5 (Leopard) Current version - 4

Notable sites that use Ruby on Rails

VersionDateNotable Enhancements 1.012/13/ /19/ /7/ /1/ /21/ /16/09Major new developments in templates, engines, Rack, and nested model forms 3.08/29/10Merb merged with Rails 3.18/31/11Reversible DB Migrations, Asset Pipeline, Streaming, jQuery, CoffeScript and Sass (added to stack) 3.21/20/12Faster development mode and routing engine (Journey), Automatic Query Explain, and Tagged Logging 4.06/25/13Introduces Russian Doll Caching (nesting fragment caches to maximize cache hits), Turbolinks (don’t have to recompile JS and CSS between each page change only replacing body and title in the head) and Live Streaming

Security vulnerabilities to note Previous versions of Rails suffer from a vulnerability that allows hackers to hijack user accounts through the use of session cookies RoR uses CookieStore as its default session storage mechanism – CookieStore contains a user’s entire session hash on the client side in the form of a web browser cookie – No information about the session is stored in the ‘sessions’ database table on a log out event and this effectively makes the cookies valid for life (not best practice)

CookieStore vulnerability, cont. Rails issues a new empty cookie to the user’s browser in order to overwrite the initial one that was authenticated. New cookie is used from that point forward, BUT: – There is no way to invalidate the old cookie! Possible attacks: – XSS (inject client-side scripts into Web pages) – session sidejacking (attacker uses packet sniffing to read network traffic between two parties to steal session cookie)

Mitigating the vulnerability Ruby 4 can now encrypt the cookie value – upgrade to 4 from current version Enforce a TTL on a session by providing a TTL value within the session; validate it when the session is read, then update the TTL value when the session is written Don’t use CookieStore

Setup Ruby can be installed from Ruby on rails is installed and executed on the ruby command line. “$ gem install rails” installs rails “$ rails new ” creates a project “$ rails server” starts rails

Model-View-Controller Ruby on Rails uses Model-View-Controller architecture. Controllers receive and process the request from the user. Models are objects that are used to create and edit the database. Views send viewable html back to the user.

Controller Controller are created this command in the ruby command line: “$ rails generate controller ” – This command creates multiple files used by the controller including the view which has the action’s name – This command also creates the routing that sends the controller the user requests.

View Views are created along with the controller or can be created separately. Views include html and ruby code – Ruby is embedded inside “ ” tags

Model Models are used to create and edit database tables. “$ rails generate model (attribute name: attribute type … )” – Eg “$ rails generate model Post title:string text:text” – “$ rake db:migrate” Must be run to create the table.

Model Example Saving data using a model def = Post.new(params[:post].permit(:title, end

Assignment Go to and work through the tutorialhttp://tryruby.org Screenshot the last page with your code to create the popup with your blog entries screenshot to