bhavesh ro r
DESCRIPTION
Primary about ruby, rails, HTML5, CoffeeScript explanation with little code spec.TRANSCRIPT
![Page 1: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/1.jpg)
Bhavesh PansheriyaRuby on Rails DeveloperGloscon Solutions Pvt. Ltd.
10-11 Sep. 2011 Workshop on Drupal & Ruby on Rails
At DDIT, Nadiad
![Page 2: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/2.jpg)
What is Ruby ?
• A dynamic, open source programming language with a focus on simplicity and productivity.
• Generic, interpreted, reflective, with garbage collection
• Optimized for people rather than computers
• Everything is an object. There are no primitive types.
• More powerful than Perl, more object oriented than Python
Yukihiro MatsumotoThe creator of Ruby1995
![Page 3: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/3.jpg)
What is Ruby ? class Person
def initialize name@name = name
end
def [email protected]*3
end
end
object_1 = Person.new “tejas”object_1.operation
OUTPUT TejasTejasTejas
![Page 4: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/4.jpg)
Where ruby is using ?
• Simulations - NASA Langley Research Center & Motorola . • 3D Modeling - Google SketchUp is a 3D modeling.
• Business - Toronto Rehab uses a RubyWebDialogs based app to manage and track on-call and on-site support.
• Robotics - At MORPHA project, Siemens service robot.
• Networking - Open Domain Server uses Ruby.
• Telephony - Within Lucent on a 3G wireless telephony product.
• Web Applications – Basecamp, 43 Things, Blue Sequence.
![Page 5: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/5.jpg)
What is Ruby on Rails (RoR) ?
• RoR is an open-source web framework uses Model-View-Controller architecture developed in Ruby.
• Web application at least ten times faster with Rails than with a typical Java framework.
• Everything in Rails (templates to control flow to business logic) is written in Ruby - Except for configuration files – YAML
David Heinemeier Hansson The creator of Rails2005
![Page 6: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/6.jpg)
Strength of Ruby on Rails ?
Best practices: MVC, DRY, Testing.
• Convention over Configuration.
• Integrated AJAX support. Web services with REST.
• Almost everything in Rails is Ruby code (SQL and JavaScript
are abstracted).
• Three environments- Development, Production, Testing.
• Ruby - less and more readable code, shorter development
times, simple but powerful, no compilation cycle.
• Metaprogramming.
• CoffeeScript, JQuery, Sass, Haml, JSON & HTTP Streaming.
![Page 7: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/7.jpg)
Directory structure of Rails 2
![Page 8: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/8.jpg)
What is MVC architecture ?
![Page 9: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/9.jpg)
Rails' MVC architecture
![Page 10: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/10.jpg)
Rails' MVC architecture in detail
![Page 11: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/11.jpg)
About Rails 3.1.0
![Page 12: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/12.jpg)
HTML5
<!DOCTYPE HTML><html> <body> <menu> <command onclick="alert('Hello World')"> Click Me!</command> </menu>
<form action="demo_keygen.rb" method="get">Username: <input type="text" name="usr_name" />Encryption: <keygen name="security" /><input type="submit" /></form>
The <abbr title="Ruby on Rails">RoR</abbr> is framework. </body></html>
![Page 13: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/13.jpg)
CoffeeScript
number = 42 var number, opposite;opposite = true number = 42;
opposite = true;
number = -42 if opposite if (opposite) number = -42;
square = (x) -> x * x square = function(x) { return x * x; };
cube = (x) -> square(x) * x cube = function(x) { return square(x) * x; };
![Page 14: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/14.jpg)
Sass is an extension of CSS3, adding nested rules, variables, mixins, selector inheritance. Sass has two syntaxes. The new main syntax (as of Sass
3) is known as “SCSS” (for “Sassy CSS”) Every valid CSS3 stylesheet is valid SCSS as well.
/* .scss */$blue: #3bbfce;$margin: 16px; /* CSS */.content-navigation { .content-navigation { border-color: $blue; border-color: #3bbfce; color:darken($blue, 9%); } color: #2b9eab; }
.border { .border { padding: $margin / 2; padding: 8px; margin: $margin / 2; margin: 8px;
border-color: $blue; } border-color: #3bbfce; }
Sass, SCSS, CSS3
![Page 15: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/15.jpg)
Who are using RoR ?
![Page 16: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/16.jpg)
Who are using RoR ?
![Page 17: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/17.jpg)
Who are using RoR ?
![Page 18: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/18.jpg)
Who are using RoR ?
![Page 19: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/19.jpg)
Who are using RoR ?
![Page 20: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/20.jpg)
Who are using RoR ?
![Page 21: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/21.jpg)
Who are using RoR ?
![Page 22: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/22.jpg)
Who are using RoR ?
![Page 23: Bhavesh ro r](https://reader034.vdocuments.net/reader034/viewer/2022052602/5599a7fa1a28ab1b3d8b45b5/html5/thumbnails/23.jpg)
?
Thank You...