Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,825 members, 7,956,121 topics. Date: Monday, 23 September 2024 at 03:34 AM

Learn Ruby On Rails Here On Nairaland - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Learn Ruby On Rails Here On Nairaland (854 Views)

Were Can I Download Free Video Tutorials On Javascript Or Ruby / Why I Love Ruby / Ilorin Ruby On Rail Programmers (2) (3) (4)

(1) (Reply) (Go Down)

Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:10am On May 29, 2015
Good day NL developers and webmasters, i will be teaching you ruby on rails here in this thread. just follow this thread and you will not regret it
Re: Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:13am On May 29, 2015
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. Sample Ruby Code: Here is a sample Ruby code to print "Hello Ruby" # Th e He l l o C l a s s c l a s s He l l o d e f i n i t i a l i z e ( n ame ) @n ame = n ame . c a p i t a l i z e e n d d e f s a l u t e p u t s " He l l o # {@n ame } ! " e n d e n d # C r e a t e a n ew o b j e c t h = He l l o . n ew ( " Ru b y " ) # Ou t p u t " He l l o Ru b y ! " h . s a l u t e 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 <% p a g e _ t i t l e = " Demo n s t r a t i o n o f ERb " %> <% s a l u t a t i o n = " De a r p r o g r amme r , " %> < h t m l > < h e a d > < t i t l e > <%= p a g e _ t i t l e %> < / t i t l e > < / h e a d > < b o d y > < p > <%= s a l u t a t i o n %> < / p > < p > Th i s i s a n e x amp l e o f h ow ERb f i l l s o u t a t emp l a t e . < / p > < / b o d y > < / h t m l > Now, run the program using the command-line utility erb c : \ r u b y \ > e r b e r b d emo . r b This will produce following result: < h t m l > < h e a d > < t i t l e >Demo n s t r a t i o n o f ERb < / t i t l e > < / h e a d > < b o d y > < p >De a r p r o g r amme r , < / p > < p > Th i s i s a n e x amp l e o f h ow ERb f i l l s o u t a t emp l a t e . < / p > < / b o d y > < / h t m l > 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.
Re: Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:19am On May 29, 2015
Rails Installation on Windows: 1. First, let's check to see if you already have
Ruby installed. Bring up a command prompt
and type ruby -v. If Ruby responds, and if it
shows a version number at or above 1.8.2
then type gem --version. If you don't get an
error, skip to step 3. Otherwise, we'll install a fresh Ruby. 2. If Ruby is not installed, then download an
installation package from rubyinstaller.rubyforge.org. Follow the download link, and run the resulting installer. This is an exe like ruby186-25.exe and will be installed in a single click. You may as well
install everything . It's a very small package,
and you'll get RubyGems as well alongwith this
package. Please check Release Notes for more detail. 3. With RubyGems loaded, you can install all of
Rails and its dependencies through the
command line: C : \ > g em i n s t a l l r a i l s - - i n c l u d e - d e p e n d e n c i e s NOTE: Above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies. Congratulations! You are now on Rails over Windows.
Re: Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:20am On May 29, 2015
Rails Installation on Mac OS X: 1. First, let's check to see if you already have
Ruby installed. Bring up a command prompt
and type ruby -v. If Ruby responds, and if it
shows a version number at or above 1.8.2
then skip to step 3. Otherwise, we'll install a
fresh Ruby. To install a fresh copy of Ruby, the Unix instructions that follow should help. 2. Next you have to install RubyGems. Go to rubygems.rubyforge.org and follow the download link. OS X will typically unpack the
archive file for you, so all you have to do is
navigate to the downloaded directory and (in
the Terminal application) type. t p > t a r x z f r u b y g ems - x . y . z . t a r . g z t p > c d r u b y g ems - x . y . z r u b y g ems - x . y . z > s u d o r u b y s e t u p . r b 3. Now use RubyGems to install Rails. Still in the
Terminal application, issue the following
command. t p > s u d o g em i n s t a l l r a i l s - - i n c l u d e - d e p e n d e n c i e s NOTE: Above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies. Congratulations! You are now on Rails over Mac OS X.
Re: Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:22am On May 29, 2015
Rails Installation on Linux: 1. First, let's check to see if you already have
Ruby installed. Bring up a command prompt
and type ruby -v. If Ruby responds, and if it
shows a version number at or above 1.8.2
then skip to step 3. Otherwise, we'll install a
fresh Ruby. 2. Download ruby-x.y.z.tar.gz from www.ruby- lang.org 3. Untar the distribution, and enter the top-level
directory. 4. Do the usual open-source build as follows t p > t a r - x z f r u b y - x . y . z . t a r . g z t p > c d r u b y - x . y . z r u b y - x . y . z > . / c o n f i g u r e r u b y - x . y . z > ma k e r u b y - x . y . z > ma k e t e s t r u b y - x . y . z > ma k e i n s t a l l 5. Install RubyGems. Go to rubygems.rubyforge.org, and follow the download link. Once you have the file locally, enter the following in your shell window. t p > t a r - x z f r u b y g ems - 0 . 8 . 1 0 . t a r . g z t p > c d r u b y g ems - 0 . 8 . 1 0 r u b y g ems - 0 . 8 . 1 0 > r u b y s e t u p . r b 6. Now use RubyGems to install Rails. Still in the
shell, issue the following command. t p > g em i n s t a l l r a i l s - - i n c l u d e - d e p e n d e n c i e s NOTE: Above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies. Congratulations! You are now on Rails over Linux.
Re: Learn Ruby On Rails Here On Nairaland by FRInteractives: 1:24am On May 29, 2015
i will pause for now and continue later, if you have any question post it here
Re: Learn Ruby On Rails Here On Nairaland by Vicben(m): 9:47am On May 29, 2015
Your texts arrangements is very poor. it's difficult reading copy and paste text.

(1) (Reply)

Save A Document / Social Media For Businesses / Android Mobile Application Development, Website Design Development And Email Mar

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 40
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.