RUBY ON RAILS
Pure object-oriented programming language.
Created in 1995 by "Matz".
Open source web application framework.
Mostly new features and improvements.
What is Ruby and Ruby on Rails:
Ruby is a programming language.
Ruby on rails is a framework that is written in Ruby.
Collection of pre-written code to help programmers.
Ruby on rails helps in making website and web application.
Framework:
Collection of program that do something useful which you use to develop some application.
Guides on how to do something.
Downloading and installing:
Variable:
Variable declaration is not needed.
Data type:
Boolean:
Has two values either true or false.
Example: bool=[true, false]
Symbols:
Used to represent objects.
Using symbols instead of string may save some resource.
Hash:
Key value pairs.
Integer:
Can be in decimal, hexadecimal, octal format.
Can be positive or negative.
String:
Represent textual data.
Example: p "Ruby"
Array:
Collection of objects.
Hello world:
Conditional execution:
Checks whether condition is true or not.
If-else:
When:
Loops:
Checking for n no of times.
For loop:
While:
Functions and calling functions:
Mathematical function:
String manipulation:
Input from user:
Replacing input from string:
Writing to file:
Reading from file:
Reading a particular line from a file:
First non-Repeated character:
Highest repeated character of string:
Permutation of string:
%w -> creates array of words.
Uses spaces to separate each value.
& -> Used to denote arguments.
Join -> Used to join.
String contains no or not:
Connecting to database:
Downloading devit.
Installing gem.
Adding path of ruby to configure.yml file.