SlideShare a Scribd company logo
Start
Ruby On Rails
Starter KIT
score: 000000 XP
Level #1
Introduction
score: 000000 XP
What is ruby?
Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was
designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.
Matsumoto has said that Ruby is designed for programmer productivity and fun, following the
principles of good user interface design
What is rails?
Ruby on Rails, or simply Rails, is a web application framework written in Ruby under MIT
License. Rails is a model–view–controller (MVC) framework, providing default structures for a
database, a web service, and web pages.
score: 000000 XP
Controller
ViewModel
+1 XP
New level has been unlocked
Level #2
Installing Rails
score: 000001 XP
Windows:
@RailsInstaller provide package included all what you need to start your first project with
Rails ( http://railsinstaller.org )
Linux&Mac:
You can install Rails with RVM (Ruby version manager) with a simple two commands:
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ curl -sSL https://get.rvm.io | bash -s stable --rails
+1 XP
New level has been unlocked
Level #2
Build your first app
score: 000002 XP
You can create a new app called (blog) by running the following
CMD:
$ rails new blog
Now we need to change the directory to our Rails App
$ cd blog
start the rails server by running
$ rails s
You can find your app on the following link below:
$ http://localhost:3000
+1 XP
New level has been unlocked
score: 000003 XP
You can create a new app called (blog) by running the following
CMD:
$ rails new blog
Now we need to change the directory to our Rails App
$ cd blog
start the rails server by running
$ rails s
You can find your app on the following link below:
$ http://localhost:3000
+1 XP
New level has been unlocked
Level #3
Start Scaffolding now
score: 000004 XP
So to make it easier creating CRUD system there is something
called scaffolding, rails have the philosophy of DRY so this
will save your time
$ rails generate scaffold post title:string content:text picture:string
Each time you create a model in rails you should migrate your
datebase with:
$ rake db:migrate
Now check your posts page in your browesr in the following
link:
$ http://localhost:3000/posts
+2 XP
New level has been unlocked
Level #4
Upload Pictures
score: 000006 XP
Firstable lets Open up the Gemfile wish is located in the root
directory of your app and add this line:
gem 'carrierwave'
Then install the Carrierwave gem:
$ bundle install
After installing the Carrierwave gem now you should create your
first Uploader, this will create picture_uploader.rb file in
app/uploaders
$ rails generate uploader Picture
score: 000006 XP
Then lets mount our uploader to the Poste Modele
app/models/poste.rb
mount_uploader :picture, PostUploader
Then lets mount our uploader to the Poste Modele
app/models/poste.rb
mount_uploader :picture, PostUploader
Now we should update our poste form
<%= f.text_field :picture %>
<%= f.file_field :picture %>
And we should update the show page also
<%= image_tag(@post.picture_url, :width => 600) if @poste.picture.present? %
:picture
+2 XP
New level has been unlocked
Level #5
Create Static Pages
score: 000008 XP
If you want to create a static page you can do it by creating a
controller with the corresponding view
$ rails generate controller pages about
Now you can visit your page through
$ http://localhost:3000/pages/about
Open up the view file corresponding to the pages#about
controller and add some info there
app/views/pages/about.html.erb
+1 XP
New level has been unlocked
Level #6
Bling Bling Baby
score: 000008 XP
Its all up to you to tweek your css file, wich is located in
the following path:
app/assets/stylesheets/application.css
If you are planning to use bootstrap so make sure you add
bootstrap to your Gemfile
gem 'bootstrap-sass', '~> 3.3.6'
Now Import bootstarp to your main application css
app/assets/stylesheets/application.scss
@import "bootstrap-sprockets";
@import "bootstrap";
+1 XP
New level has been unlocked
Level #7
Make some serious relations
score: 000009 XP
Create a comment scaffold, with the commentator name, the
comment body (contents of the comment) and with the reference
to the ideas table (post_id).
$ rails g scaffold comment user_name:string body:text post_id:integer
Then migrate your datebase:
rake db:migrate
Openup poste model File app/models/post.rb and add
has_many :comments
score: 000009 XP
And from the comment side add
belongs_to :post
And from the comment side add
<h3>Comments</h3>
<% @comments.each do |comment| %>
<div>
<strong><%= comment.user_name %></strong>
<br />
<p><%= comment.body %></p>
<p><%= link_to 'Delete', comment_path(comment), method: :delete, data: { confirm: 'Are you
sure?' } %></p>
</div>
<% end %>
<%= render 'comments/form' %>
score: 000009 XP
Lets modifier the app/controllers/ideas_controller.rb to get
fit with what we did in the previously changes
@comments = @idea.comments.all
@comment = @idea.comments.build
And also add the following line
app/views/comments/_form.html.erb
<%= f.hidden_field :idea_id %>
Congratulation!!
you finished all the levels
of the game
With 10 XP
Now you are ready for another levels
of the game but you need extra life points !!
So follow us on
Facebook Group Rails on Algeria
FB: El Orabi Mohamed Ikbal ikbalix@gmail.com

More Related Content

PDF
Top laravel packages to install handpicked list from expert
PDF
Task scheduling in laravel 8 tutorial
PDF
How to deploy laravel application on aws ec2
PDF
Installing php 7.4 Nginx Laravel 7.x on Centos 8
PPTX
Dev streams2
PDF
Laravel mail example how to send an email using markdown template in laravel 8
PPTX
Ruby on Rails - An overview
PDF
Be Happy With Ruby on Rails - Ecosystem
Top laravel packages to install handpicked list from expert
Task scheduling in laravel 8 tutorial
How to deploy laravel application on aws ec2
Installing php 7.4 Nginx Laravel 7.x on Centos 8
Dev streams2
Laravel mail example how to send an email using markdown template in laravel 8
Ruby on Rails - An overview
Be Happy With Ruby on Rails - Ecosystem

What's hot (20)

PDF
Laravel presentation
PDF
How to dockerize rails application compose and rails tutorial
PDF
Laravel 5 In Depth
PDF
Webpack Encore Symfony Live 2017 San Francisco
PPTX
Mule velocity
PDF
Getting Started with WP-CLI
PDF
RESTful API development in Laravel 4 - Christopher Pecoraro
PPT
Ruby on Rails workshop for beginner
PDF
Introduction to Laravel
PDF
Building Application with Ruby On Rails Framework
PPT
Slim3 quick start
PDF
NodeJS : Communication and Round Robin Way
ODP
Javascript laravel's friend
PDF
Weblogic as a windows service
PDF
Enterprising JavaFX
PDF
Laravel 5 Annotations: RESTful API routing
PPTX
Node JS Express : Steps to Create Restful Web App
PPTX
Laravel Eloquent ORM
PPT
Developing Plugins For WordPress
Laravel presentation
How to dockerize rails application compose and rails tutorial
Laravel 5 In Depth
Webpack Encore Symfony Live 2017 San Francisco
Mule velocity
Getting Started with WP-CLI
RESTful API development in Laravel 4 - Christopher Pecoraro
Ruby on Rails workshop for beginner
Introduction to Laravel
Building Application with Ruby On Rails Framework
Slim3 quick start
NodeJS : Communication and Round Robin Way
Javascript laravel's friend
Weblogic as a windows service
Enterprising JavaFX
Laravel 5 Annotations: RESTful API routing
Node JS Express : Steps to Create Restful Web App
Laravel Eloquent ORM
Developing Plugins For WordPress
Ad

Similar to Ruby On Rails Starter Kit (20)

PDF
ragi_tutorial_v1
PDF
ragi_tutorial_v1
DOCX
Guide - Migrating from Heroku to AWS using CloudFormation
PDF
Ruby Rails Web Development.pdf
PDF
Ruby On Rails
PDF
Create a new project in ROR
PDF
All girlhacknight intro to rails
PDF
Ruby on Rails Scaffold_ Create Your App In Minutes
PPT
Rails
 
PDF
Gigigo Rails Workshop
KEY
Supa fast Ruby + Rails
PPTX
RoR guide_p1
PPTX
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
PDF
Introduction to Rails - presented by Arman Ortega
PDF
rails.html
PDF
rails.html
DOCX
Lampstack (1)
PDF
Create rails project
KEY
Rails web api 开发
ragi_tutorial_v1
ragi_tutorial_v1
Guide - Migrating from Heroku to AWS using CloudFormation
Ruby Rails Web Development.pdf
Ruby On Rails
Create a new project in ROR
All girlhacknight intro to rails
Ruby on Rails Scaffold_ Create Your App In Minutes
Rails
 
Gigigo Rails Workshop
Supa fast Ruby + Rails
RoR guide_p1
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Introduction to Rails - presented by Arman Ortega
rails.html
rails.html
Lampstack (1)
Create rails project
Rails web api 开发
Ad

Recently uploaded (20)

PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Modernizing your data center with Dell and AMD
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
PDF
Advanced IT Governance
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Chapter 3 Spatial Domain Image Processing.pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Advanced Soft Computing BINUS July 2025.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Transforming Manufacturing operations through Intelligent Integrations
NewMind AI Monthly Chronicles - July 2025
Modernizing your data center with Dell and AMD
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx
Advanced IT Governance
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I

Ruby On Rails Starter Kit

  • 1. Start Ruby On Rails Starter KIT score: 000000 XP
  • 3. score: 000000 XP What is ruby? Ruby is a dynamic, reflective, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. Matsumoto has said that Ruby is designed for programmer productivity and fun, following the principles of good user interface design What is rails? Ruby on Rails, or simply Rails, is a web application framework written in Ruby under MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.
  • 5. +1 XP New level has been unlocked
  • 7. score: 000001 XP Windows: @RailsInstaller provide package included all what you need to start your first project with Rails ( http://railsinstaller.org ) Linux&Mac: You can install Rails with RVM (Ruby version manager) with a simple two commands: $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 $ curl -sSL https://get.rvm.io | bash -s stable --rails
  • 8. +1 XP New level has been unlocked
  • 10. score: 000002 XP You can create a new app called (blog) by running the following CMD: $ rails new blog Now we need to change the directory to our Rails App $ cd blog start the rails server by running $ rails s You can find your app on the following link below: $ http://localhost:3000
  • 11. +1 XP New level has been unlocked
  • 12. score: 000003 XP You can create a new app called (blog) by running the following CMD: $ rails new blog Now we need to change the directory to our Rails App $ cd blog start the rails server by running $ rails s You can find your app on the following link below: $ http://localhost:3000
  • 13. +1 XP New level has been unlocked
  • 15. score: 000004 XP So to make it easier creating CRUD system there is something called scaffolding, rails have the philosophy of DRY so this will save your time $ rails generate scaffold post title:string content:text picture:string Each time you create a model in rails you should migrate your datebase with: $ rake db:migrate Now check your posts page in your browesr in the following link: $ http://localhost:3000/posts
  • 16. +2 XP New level has been unlocked
  • 18. score: 000006 XP Firstable lets Open up the Gemfile wish is located in the root directory of your app and add this line: gem 'carrierwave' Then install the Carrierwave gem: $ bundle install After installing the Carrierwave gem now you should create your first Uploader, this will create picture_uploader.rb file in app/uploaders $ rails generate uploader Picture
  • 19. score: 000006 XP Then lets mount our uploader to the Poste Modele app/models/poste.rb mount_uploader :picture, PostUploader Then lets mount our uploader to the Poste Modele app/models/poste.rb mount_uploader :picture, PostUploader Now we should update our poste form <%= f.text_field :picture %> <%= f.file_field :picture %> And we should update the show page also <%= image_tag(@post.picture_url, :width => 600) if @poste.picture.present? % :picture
  • 20. +2 XP New level has been unlocked
  • 22. score: 000008 XP If you want to create a static page you can do it by creating a controller with the corresponding view $ rails generate controller pages about Now you can visit your page through $ http://localhost:3000/pages/about Open up the view file corresponding to the pages#about controller and add some info there app/views/pages/about.html.erb
  • 23. +1 XP New level has been unlocked
  • 25. score: 000008 XP Its all up to you to tweek your css file, wich is located in the following path: app/assets/stylesheets/application.css If you are planning to use bootstrap so make sure you add bootstrap to your Gemfile gem 'bootstrap-sass', '~> 3.3.6' Now Import bootstarp to your main application css app/assets/stylesheets/application.scss @import "bootstrap-sprockets"; @import "bootstrap";
  • 26. +1 XP New level has been unlocked
  • 27. Level #7 Make some serious relations
  • 28. score: 000009 XP Create a comment scaffold, with the commentator name, the comment body (contents of the comment) and with the reference to the ideas table (post_id). $ rails g scaffold comment user_name:string body:text post_id:integer Then migrate your datebase: rake db:migrate Openup poste model File app/models/post.rb and add has_many :comments
  • 29. score: 000009 XP And from the comment side add belongs_to :post And from the comment side add <h3>Comments</h3> <% @comments.each do |comment| %> <div> <strong><%= comment.user_name %></strong> <br /> <p><%= comment.body %></p> <p><%= link_to 'Delete', comment_path(comment), method: :delete, data: { confirm: 'Are you sure?' } %></p> </div> <% end %> <%= render 'comments/form' %>
  • 30. score: 000009 XP Lets modifier the app/controllers/ideas_controller.rb to get fit with what we did in the previously changes @comments = @idea.comments.all @comment = @idea.comments.build And also add the following line app/views/comments/_form.html.erb <%= f.hidden_field :idea_id %>
  • 31. Congratulation!! you finished all the levels of the game With 10 XP
  • 32. Now you are ready for another levels of the game but you need extra life points !!
  • 33. So follow us on Facebook Group Rails on Algeria FB: El Orabi Mohamed Ikbal [email protected]