10-11 Sep. 2011 Workshop on Drupal & Ruby on Rails

       At DDIT, Nadiad




                                      Bhavesh Pansheriya
                                      Ruby on Rails Developer
                                      Gloscon Solutions Pvt. Ltd.
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        Yukihiro Matsumoto
                                                      The creator of Ruby
                                                      1995
•   Everything is an object. There are no primitive
    types.

•   More powerful than Perl, more object oriented
    than Python
What is Ruby ?
class Person

  def initialize name
    @name = name
  end

  def operation
    @name.capitalize*3
  end

end

object_1 = Person.new “tejas”
object_1.operation

OUTPUT TejasTejasTejas
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.
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
                                                        David Heinemeier
    Rails than with a typical Java framework.           Hansson
                                                        The creator of Rails
                                                        2005
•   Everything in Rails (templates to control flow to
     business logic) is written in Ruby
          - Except for configuration files – YAML
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.
Directory structure of Rails 2
What is MVC architecture ?
Rails' MVC architecture
Rails' MVC architecture in detail
About Rails 3.1.0
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>
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;
                                       };
Sass, SCSS, CSS3
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; }
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
Who are using RoR ?
?

Thank You...

Bhavesh ro r

  • 1.
    10-11 Sep. 2011Workshop on Drupal & Ruby on Rails At DDIT, Nadiad Bhavesh Pansheriya Ruby on Rails Developer Gloscon Solutions Pvt. Ltd.
  • 2.
    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 Yukihiro Matsumoto The creator of Ruby 1995 • Everything is an object. There are no primitive types. • More powerful than Perl, more object oriented than Python
  • 3.
    What is Ruby? class Person def initialize name @name = name end def operation @name.capitalize*3 end end object_1 = Person.new “tejas” object_1.operation OUTPUT TejasTejasTejas
  • 4.
    Where ruby isusing ? • 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.
  • 5.
    What is Rubyon 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 David Heinemeier Rails than with a typical Java framework. Hansson The creator of Rails 2005 • Everything in Rails (templates to control flow to business logic) is written in Ruby - Except for configuration files – YAML
  • 6.
    Strength of Rubyon 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.
  • 7.
  • 8.
    What is MVCarchitecture ?
  • 9.
  • 10.
  • 11.
  • 12.
    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>
  • 13.
    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; };
  • 14.
    Sass, SCSS, CSS3 Sassis 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; }
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.