BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Welcome to all the Students > Tutorial > Networking/Ethical Hacking

Networking/Ethical Hacking Are you a hacker? Then prove it here!


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 13-07-2008, 08:46 PM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Ruby On Rails Tutorial

Name:  rails.jpg
Views: 353
Size:  3.3 KB
Ruby on Rails is an extremely productive web application framework written in Ruby by David Heinemeier Hansson.

This is a open source Ruby framework for developing database-backed web applications.

This tutorial will give you a complete understanding on Ruby on Rails.


What is Ruby ?

Before we ride on Rails, let's know a little bit about Ruby which is the base of Rails.

Ruby is the successful combination of:
Smalltalk's conceptual elegance,
Python's ease of use and learning, and
Perl's pragmatism

Ruby is A High Level Programming Language
Interpreted like Perl, Python, Tcl/TK.
Object-Oriented Like Smalltalk, Eiffel, Ada, Java.
Originated in Japan and Rapidly Gaining Mindshare in US and Europe.

Why Ruby ?

Ruby is becoming popular exponentially in Japan and now in US and Europe as well. Following are greatest factors:
Easy to learn
Open source (very liberal license)
Rich libraries
Very easy to extend
Truly Object-Oriented
Less Coding with fewer bugs
Helpful community
Why Not Ruby ?
Performance - Although it rivals Perl and Python.
Threading model does not use native threads.
Reply With Quote
  #2  
Old 13-07-2008, 10:10 PM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Ruby On Rails Tutorial

Sample Ruby Code:

Here is a sample Ruby code to print "Hello Ruby" # The Hello Class
Quote:
class Hello
def initialize( name )
@name = name.capitalize
end

def salute
puts "Hello #{@name}!"
end
end
# Create a new object
h = Hello.new("Ruby")
# Output "Hello Ruby!"
h.salute
Embedded Ruby:

Ruby provides you with a program called ERb (Embedded Ruby), written by Seki Masatoshi. ERb allows you to put Ruby code inside an HTML file. ERb reads along, word for word, and then at a certain point when it sees the Ruby code embedded in the document it sees that it has to fill in a blank, which it does by executing the Ruby code.

You need to know only two things to prepare an ERb document:

If you want some Ruby code executed, enclose it between <% and %>

If you want the result of the code execution to be printed out, as part of the output, enclose the code between <%= and %>.

Here's an example, Save the code in erbdemo.rb file. Please note that a ruby file will have extension .rb

Quote:
<% page_title = "Demonstration of ERb" %>
<% salutation = "Dear programmer," %>


<%= page_title %>


<%= salutation %>


This is an example of how ERb fills out a template.




Now, run the program using the command-line utility erbc:\ruby\>erb erbdemo.rb


This will produce following result:
Quote:


Demonstration of ERb


Dear programmer,


This is an example of how ERb fills out a template.



What is Rails
An extremely productive web-application framework.
Written in Ruby by David Heinemeier Hansson.
You could develop a web application at least ten times faster with Rails than you could with a typical Java framework.
An open source Ruby framework for developing database-backed web applications.
Your code and database schema are the configuration!
No compilation phase required.
Full Stack Framework
Includes everything needed to create a database-driven web application using the Model-View-Controller pattern.
Being a full-stack framework means that all layers are built to work seamlessly together Less Code.
Requires fewer total lines of code than other frameworks spend setting up their XML configuration files.
Convention over Configuration
Rails shuns configuration files in favor of conventions, reflection and dynamic run-time extensions. Your application code and your running database already contain everything that Rails needs to know!
Rails Strengths:

Rails is packed with features that make you more productive, with many of the following features building on one other.

Metaprogramming : Other frameworks use extensive code generation from scratch. Metaprogramming techniques use programs to write programs. Ruby is one of the best languages for metaprogramming, and Rails uses this capability well. Rails also uses code generation but relies much more on metaprogramming for the heavy lifting.

Active Record : Rails introduces the Active Record framework, which saves objects to the database. The Rails version of Active Record discovers the columns in a database schema and automatically attaches them to your domain objects using metaprogramming.

Convention over configuration: Most web development frameworks for .NET or Java force you to write pages of configuration code. If you follow suggested naming conventions, Rails doesn't need much configuration.

Scaffolding: You often create temporary code in the early stages of development to help get an application up quickly and see how major components work together. Rails automatically creates much of the scaffolding you'll need.

Built-in testing: Rails creates simple automated tests you can then extend. Rails also provides supporting code called harnesses and fixtures that make test cases easier to write and run. Ruby can then execute all your automated tests with the rake utility.

Three environments: Rails gives you three default environments: development, testing, and production. Each behaves slightly differently, making your entire software development cycle easier. For example, Rails creates a fresh copy of the Test database for each test run.
Reply With Quote
Reply

Tags
rails, ruby, tutorial


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SS7 Tutorial bonfire Digital Telephony 0 15-12-2010 09:48 PM
[TUT] SQL Injection Tutorial for Beginners Chull Bull Pandey Networking/Ethical Hacking 0 12-11-2010 11:33 AM
AutoCAD 2008 - Tutorial 01 Ch|Iftikhar Howto & Style 0 02-11-2009 09:31 PM
Groovy with Grails - Java’s fight back to Ruby on Rails BSIT07-01 Computer & Programming 1 30-09-2008 10:06 AM
VOIP etc from XP LAB >>Not tutorial just raw material .BZU. ETC 0 27-12-2007 02:49 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 02:17 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.