SlideShare a Scribd company logo
One word … Beautiful
 Rails is a web application development
framework written in the Ruby language. It is
designed to make programming web
applications easier by making assumptions
about what every developer needs to get
started.
 DRY – “Don’t Repeat Yourself”
 Convention Over
 REST is the best pattern for web applications
 Rails installer
 Aaaaaaand it is done
 Update using
 Gem update --system
 Gem update
 Model : Data layer
 Views : Presentation layer
 Controller : Linking between mode and views
rails new blog
 cd blog
 rails server
 localhost:3000
 Delete public/index.html
 Generate index page
 rails generate controller home index
 set homepage
 root :to => "home#index"
 Create scaffold along with a model
 rails generate scaffold post name:string
title:string content:text
 rake db:migrate
 Add link to home page
 <%= link_to "My Blog", posts_path %>
 validates :name, :presence => true
 validates :title, :presence => true, :length
=> { :minimum => 5 }
 Create model
 rails generate model comment commenter:string
body:text post:references
 rake db:migrate
 Add repation to post model
 has_many :comments
 Add it as subresource to post
 resources :posts do
 resources :comments
 end
 Create controller
 rails generate controller Comments
 Add a comment:
 <%= form_for([@post,
@post.comments.build]) do |f| %>
 <%= f.label :commenter %>
 <%= f.text_field :commenter %>
 <%= f.label :body %>
 <%= f.text_area :body %>
 <%= f.submit %>
 <% end %>
 @post = Post.find(params[:post_id])
 @comment =
@post.comments.create(params[:comment])
 redirect_to post_path(@post)
 <h2>Comments</h2>
 <% @post.comments.each do |comment| %>
 Commenter: <%= comment.commenter %>
 Comment: <%= comment.body %>
 <br/>
 <% end %>
 Add user name and password
 http_basic_authenticate_with :name => “admin",
:password => “admin", :except => [:index, :show]
 Tags
 Comments moderation
 Images for post
 Attached youtube video to post
 Posts categories
 … what else ?
 Implement new ideas with your team
 Read
 http://haml.info/tutorial.html
 http://haml.info/docs/yardoc/file.REFERENCE.h
tml
Ruby on rails3 - introduction to rails

More Related Content

What's hot (20)

Web Os Hands On
Web Os Hands On
360|Conferences
 
Mule with salesforce push topic notification copy
Mule with salesforce push topic notification copy
Sanjeet Pandey
 
Application Server-less Web Applications - Serverless Toronto Meetup
Application Server-less Web Applications - Serverless Toronto Meetup
Daniel Zivkovic
 
Ajax control asp.net
Ajax control asp.net
Sireesh K
 
Tutorial asp.net
Tutorial asp.net
Vivek K. Singh
 
Rails introduction
Rails introduction
Павел Калашников
 
Pundit
Pundit
Bruce White
 
API Proxy Auto Discovery
API Proxy Auto Discovery
Vince Soliza
 
Asp.net controls
Asp.net controls
baabtra.com - No. 1 supplier of quality freshers
 
Mule with facebook
Mule with facebook
D.Rajesh Kumar
 
ASP.NET Session 9
ASP.NET Session 9
Sisir Ghosh
 
ASP.NET Lecture 1
ASP.NET Lecture 1
Julie Iskander
 
Anypoint lessons
Anypoint lessons
Dwight Cavalcanti
 
You Know WebOS
You Know WebOS
360|Conferences
 
Asp.net
Asp.net
Dinesh kumar
 
Automatic documentation with mule
Automatic documentation with mule
F K
 
Mule
Mule
irfan1008
 
RBC Mod 1: Making a New Rails App
RBC Mod 1: Making a New Rails App
ameedahc
 
Building Cool apps with flex
Building Cool apps with flex
Joseph Khan
 
Introduction to Adobe Flex - Zaloni
Introduction to Adobe Flex - Zaloni
Joseph Khan
 

Viewers also liked (20)

Ruby On Rails Introduction
Ruby On Rails Introduction
Gustavo Andres Brey
 
Quick introduction to Ruby on Rails
Quick introduction to Ruby on Rails
Whitesmith
 
Highcharts
Highcharts
Knoldus Inc.
 
Dynamic Data Visualization With Chartkick
Dynamic Data Visualization With Chartkick
Dax Murray
 
Postgre sql unleashed
Postgre sql unleashed
Marian Marinov
 
Load Balancing with Apache
Load Balancing with Apache
Bradley Holt
 
Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4
HighLoad2009
 
Elastic search overview
Elastic search overview
ABC Talks
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutes
David Pilato
 
ElasticSearch Basic Introduction
ElasticSearch Basic Introduction
Mayur Rathod
 
Ruby on Rails, a brief introduction
Ruby on Rails, a brief introduction
roaldnel
 
Hello world ios v1
Hello world ios v1
Teodoro Alonso
 
Introduction to Rails
Introduction to Rails
Menno van der Sman
 
Ruby on Rails: a brief introduction
Ruby on Rails: a brief introduction
Luigi De Russis
 
Ruby on rails evaluation
Ruby on rails evaluation
Luis Goldster
 
a-beginners-guide-to-namas-web_final
a-beginners-guide-to-namas-web_final
Urska Trunk
 
Beginners Guide for iPhone & iPad
Beginners Guide for iPhone & iPad
Jonathan Bacon
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
arman o
 
Introduction to Rails
Introduction to Rails
alkeshv
 
Uri Nachmias - Adopting Swift @Houzz - The good, the bad and the ugly
Uri Nachmias - Adopting Swift @Houzz - The good, the bad and the ugly
tlv-ios-dev
 
Quick introduction to Ruby on Rails
Quick introduction to Ruby on Rails
Whitesmith
 
Dynamic Data Visualization With Chartkick
Dynamic Data Visualization With Chartkick
Dax Murray
 
Load Balancing with Apache
Load Balancing with Apache
Bradley Holt
 
Performance Enhancements In Postgre Sql 8.4
Performance Enhancements In Postgre Sql 8.4
HighLoad2009
 
Elastic search overview
Elastic search overview
ABC Talks
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutes
David Pilato
 
ElasticSearch Basic Introduction
ElasticSearch Basic Introduction
Mayur Rathod
 
Ruby on Rails, a brief introduction
Ruby on Rails, a brief introduction
roaldnel
 
Ruby on Rails: a brief introduction
Ruby on Rails: a brief introduction
Luigi De Russis
 
Ruby on rails evaluation
Ruby on rails evaluation
Luis Goldster
 
a-beginners-guide-to-namas-web_final
a-beginners-guide-to-namas-web_final
Urska Trunk
 
Beginners Guide for iPhone & iPad
Beginners Guide for iPhone & iPad
Jonathan Bacon
 
Introduction to Rails - presented by Arman Ortega
Introduction to Rails - presented by Arman Ortega
arman o
 
Introduction to Rails
Introduction to Rails
alkeshv
 
Uri Nachmias - Adopting Swift @Houzz - The good, the bad and the ugly
Uri Nachmias - Adopting Swift @Houzz - The good, the bad and the ugly
tlv-ios-dev
 
Ad

Similar to Ruby on rails3 - introduction to rails (20)

Web api
Web api
udaiappa
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Pankaj Bhageria
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
Getting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
 
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Andrew Ly
 
Nodejs.meetup
Nodejs.meetup
Vivian S. Zhang
 
Asp.net
Asp.net
Naveen Sihag
 
Useful Rails Plugins
Useful Rails Plugins
navjeet
 
Rails notification
Rails notification
baran19901990
 
Asp.net architecture
Asp.net architecture
Iblesoft
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
04 asp.net session05
04 asp.net session05
Vivek Singh Chandel
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
Introduction To CodeIgniter
Introduction To CodeIgniter
Muhammad Hafiz Hasan
 
Introduction To Mvc
Introduction To Mvc
Volkan Uzun
 
Phoenix for Rails Devs
Phoenix for Rails Devs
Diacode
 
Creating web form
Creating web form
mentorrbuddy
 
Creating web form
Creating web form
mentorrbuddy
 
Asp.net server controls
Asp.net server controls
Raed Aldahdooh
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Pankaj Bhageria
 
Overview of ASP.Net by software outsourcing company india
Overview of ASP.Net by software outsourcing company india
Jignesh Aakoliya
 
Getting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
 
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Summit Australia 2019 - PowerApp Portals - Andrew Ly & Lachlan Wright
Andrew Ly
 
Useful Rails Plugins
Useful Rails Plugins
navjeet
 
Asp.net architecture
Asp.net architecture
Iblesoft
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
8-9-10. ASP_updated8-9-10. ASP_updated8-9-10. ASP_updated
dioduong345
 
Introduction To Mvc
Introduction To Mvc
Volkan Uzun
 
Phoenix for Rails Devs
Phoenix for Rails Devs
Diacode
 
Asp.net server controls
Asp.net server controls
Raed Aldahdooh
 
Ad

Recently uploaded (20)

War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance Seminar State of Passkeys.pptx
FIDO Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 

Ruby on rails3 - introduction to rails

  • 1. One word … Beautiful
  • 2.  Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started.
  • 3.  DRY – “Don’t Repeat Yourself”  Convention Over  REST is the best pattern for web applications
  • 4.  Rails installer  Aaaaaaand it is done  Update using  Gem update --system  Gem update
  • 5.  Model : Data layer  Views : Presentation layer  Controller : Linking between mode and views
  • 7.  cd blog  rails server  localhost:3000
  • 8.  Delete public/index.html  Generate index page  rails generate controller home index  set homepage  root :to => "home#index"
  • 9.  Create scaffold along with a model  rails generate scaffold post name:string title:string content:text  rake db:migrate  Add link to home page  <%= link_to "My Blog", posts_path %>
  • 10.  validates :name, :presence => true  validates :title, :presence => true, :length => { :minimum => 5 }
  • 11.  Create model  rails generate model comment commenter:string body:text post:references  rake db:migrate  Add repation to post model  has_many :comments  Add it as subresource to post  resources :posts do  resources :comments  end  Create controller  rails generate controller Comments
  • 12.  Add a comment:  <%= form_for([@post, @post.comments.build]) do |f| %>  <%= f.label :commenter %>  <%= f.text_field :commenter %>  <%= f.label :body %>  <%= f.text_area :body %>  <%= f.submit %>  <% end %>
  • 13.  @post = Post.find(params[:post_id])  @comment = @post.comments.create(params[:comment])  redirect_to post_path(@post)
  • 14.  <h2>Comments</h2>  <% @post.comments.each do |comment| %>  Commenter: <%= comment.commenter %>  Comment: <%= comment.body %>  <br/>  <% end %>
  • 15.  Add user name and password  http_basic_authenticate_with :name => “admin", :password => “admin", :except => [:index, :show]
  • 16.  Tags  Comments moderation  Images for post  Attached youtube video to post  Posts categories  … what else ?
  • 17.  Implement new ideas with your team  Read  http://haml.info/tutorial.html  http://haml.info/docs/yardoc/file.REFERENCE.h tml