SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Lets make a
rails app
Nola Stowe, @rubygeekdotcom
www.rubygeek.com
Install Ruby and Rails
1. Go to http://railsinstaller.org/
2. Download the installer for your operating
system
3. Run the installer

Find where it is installed and verify that you can
run a console/shell window.
Create an app
The App we will make will be a list of resources
we can use to learn ruby.


rails new learning_tree
Create a scaffold
Scaffolding is used to make a controller, model and
view. Its basic but its a nice way to start an app.

cd learning_tree

rails g scaffold task
              name:string url:string description:text
rails destroy scaffold task (will undo previous)
Use singular version!!
Add a default route
edit config/routes.rb

Add:

root :to => 'tasks#index'

remove file:
    public/index.html
Migrate your database
sqlite is used by default, make it easy to start
working in rails right away

rake db:migrate
Run your app

rails server

or

rails s
Try your app

Open your browser and go to http://localhost:
3000


Rails default port is 3000
Ready to customize
Lets change the task index to make the url a
link


 <td><%= link_to(task.url, task.url) %></td>

link_to ( name of the link, url of link )
Move delete link to show
I dont like the delete link to be so easily edited,
so I move it to the show page.

<%= link_to 'Destroy', @task, method: :delete,
data: { confirm: 'Are you sure?' } %> |

change task to @task to use the instance
variable
Other ideas?
Can you think of some other things we can
change/add for this app?
Resources
http://blog.rubygeek.com/getting-started

http://www.railscast.com

http://www.codeschool.com

http://rubeque.com

Más contenido relacionado

La actualidad más candente

Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Andolasoft Inc
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the thingsJohn Cleary
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events51 lecture
 
Webオペレーション研修イントロダクション
Webオペレーション研修イントロダクションWebオペレーション研修イントロダクション
Webオペレーション研修イントロダクションJoe_noh
 
Introduction to Rails 3
Introduction to Rails 3Introduction to Rails 3
Introduction to Rails 3Anup Nivargi
 
Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on HerokuEric Johnson
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2Akhil Bansal
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!David Roberts
 
Creating custom aggregation strategy
Creating custom aggregation strategyCreating custom aggregation strategy
Creating custom aggregation strategyRahul Kumar
 
Apikit in studio
Apikit in studioApikit in studio
Apikit in studiofedefortin
 
Creating custom aggregator
Creating custom aggregatorCreating custom aggregator
Creating custom aggregatorRahul Kumar
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging AgentMatthieu Vachon
 
Log grid root
Log grid rootLog grid root
Log grid rootopenmi
 
Introduction to ElasticSearch
Introduction to ElasticSearchIntroduction to ElasticSearch
Introduction to ElasticSearchSimobo
 
Laravel Events And Queue
Laravel Events And QueueLaravel Events And Queue
Laravel Events And QueueVivek S
 

La actualidad más candente (19)

Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the things
 
M S Ajax Client Life Cycle Events
M S  Ajax  Client  Life  Cycle  EventsM S  Ajax  Client  Life  Cycle  Events
M S Ajax Client Life Cycle Events
 
Webオペレーション研修イントロダクション
Webオペレーション研修イントロダクションWebオペレーション研修イントロダクション
Webオペレーション研修イントロダクション
 
Introduction to Rails 3
Introduction to Rails 3Introduction to Rails 3
Introduction to Rails 3
 
Deploy Laravel on Heroku
Deploy Laravel on HerokuDeploy Laravel on Heroku
Deploy Laravel on Heroku
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2
 
RoR guide_p1
RoR guide_p1RoR guide_p1
RoR guide_p1
 
Lucene application
Lucene applicationLucene application
Lucene application
 
Event Source On Labs
Event Source On LabsEvent Source On Labs
Event Source On Labs
 
Why you should add React to your Rails application now!
Why you should add React to your Rails application now!Why you should add React to your Rails application now!
Why you should add React to your Rails application now!
 
Creating custom aggregation strategy
Creating custom aggregation strategyCreating custom aggregation strategy
Creating custom aggregation strategy
 
Apikit in studio
Apikit in studioApikit in studio
Apikit in studio
 
Creating custom aggregator
Creating custom aggregatorCreating custom aggregator
Creating custom aggregator
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging Agent
 
Log grid root
Log grid rootLog grid root
Log grid root
 
Introduction to ElasticSearch
Introduction to ElasticSearchIntroduction to ElasticSearch
Introduction to ElasticSearch
 
Laravel Events And Queue
Laravel Events And QueueLaravel Events And Queue
Laravel Events And Queue
 

Destacado

международные конвенции и договоры об интеллектуальной собственности
международные конвенции и договоры об интеллектуальной собственностимеждународные конвенции и договоры об интеллектуальной собственности
международные конвенции и договоры об интеллектуальной собственностиareginalnaia
 
Jekyll and MrBlog
Jekyll and MrBlogJekyll and MrBlog
Jekyll and MrBlogNola Stowe
 
Getting better through Katas
Getting better through KatasGetting better through Katas
Getting better through KatasNola Stowe
 
Women Who Code Functional Programming - 9/26/2016
Women Who Code   Functional Programming - 9/26/2016Women Who Code   Functional Programming - 9/26/2016
Women Who Code Functional Programming - 9/26/2016Nola Stowe
 
Dart: Another Tool in the Toolbox
Dart: Another Tool in the ToolboxDart: Another Tool in the Toolbox
Dart: Another Tool in the ToolboxNola Stowe
 
Manjemen produksi dan operasi
Manjemen produksi dan operasiManjemen produksi dan operasi
Manjemen produksi dan operasiHidayat Ramadhan
 
Ruby Data Types and Data Structures
Ruby Data Types and Data StructuresRuby Data Types and Data Structures
Ruby Data Types and Data StructuresNola Stowe
 
Beginning Clojure at AustinClojure Meetup
Beginning Clojure at AustinClojure MeetupBeginning Clojure at AustinClojure Meetup
Beginning Clojure at AustinClojure MeetupNola Stowe
 
Intro to Clojure lightningtalk
Intro to Clojure lightningtalkIntro to Clojure lightningtalk
Intro to Clojure lightningtalkNola Stowe
 
Intro to Clojure 4 Developers
Intro to Clojure 4 DevelopersIntro to Clojure 4 Developers
Intro to Clojure 4 DevelopersNola Stowe
 
EKONOMI & MANAJEMEN AGRIBISNIS
EKONOMI & MANAJEMEN AGRIBISNISEKONOMI & MANAJEMEN AGRIBISNIS
EKONOMI & MANAJEMEN AGRIBISNISHidayat Ramadhan
 
How to Run a ClojureBridge Workshop
How to Run a ClojureBridge WorkshopHow to Run a ClojureBridge Workshop
How to Run a ClojureBridge WorkshopNola Stowe
 
Euptoieta claudia hortensia
Euptoieta claudia hortensiaEuptoieta claudia hortensia
Euptoieta claudia hortensiaMárcio Martins
 

Destacado (16)

международные конвенции и договоры об интеллектуальной собственности
международные конвенции и договоры об интеллектуальной собственностимеждународные конвенции и договоры об интеллектуальной собственности
международные конвенции и договоры об интеллектуальной собственности
 
Jekyll and MrBlog
Jekyll and MrBlogJekyll and MrBlog
Jekyll and MrBlog
 
Getting better through Katas
Getting better through KatasGetting better through Katas
Getting better through Katas
 
Presenters
PresentersPresenters
Presenters
 
Women Who Code Functional Programming - 9/26/2016
Women Who Code   Functional Programming - 9/26/2016Women Who Code   Functional Programming - 9/26/2016
Women Who Code Functional Programming - 9/26/2016
 
Dart: Another Tool in the Toolbox
Dart: Another Tool in the ToolboxDart: Another Tool in the Toolbox
Dart: Another Tool in the Toolbox
 
Manjemen produksi dan operasi
Manjemen produksi dan operasiManjemen produksi dan operasi
Manjemen produksi dan operasi
 
Ruby101
Ruby101Ruby101
Ruby101
 
Ruby Data Types and Data Structures
Ruby Data Types and Data StructuresRuby Data Types and Data Structures
Ruby Data Types and Data Structures
 
Beginning Clojure at AustinClojure Meetup
Beginning Clojure at AustinClojure MeetupBeginning Clojure at AustinClojure Meetup
Beginning Clojure at AustinClojure Meetup
 
Intro to Clojure lightningtalk
Intro to Clojure lightningtalkIntro to Clojure lightningtalk
Intro to Clojure lightningtalk
 
Intro to Clojure 4 Developers
Intro to Clojure 4 DevelopersIntro to Clojure 4 Developers
Intro to Clojure 4 Developers
 
EKONOMI & MANAJEMEN AGRIBISNIS
EKONOMI & MANAJEMEN AGRIBISNISEKONOMI & MANAJEMEN AGRIBISNIS
EKONOMI & MANAJEMEN AGRIBISNIS
 
How to Run a ClojureBridge Workshop
How to Run a ClojureBridge WorkshopHow to Run a ClojureBridge Workshop
How to Run a ClojureBridge Workshop
 
Euptoieta claudia hortensia
Euptoieta claudia hortensiaEuptoieta claudia hortensia
Euptoieta claudia hortensia
 
Pseudoscada erruca
Pseudoscada errucaPseudoscada erruca
Pseudoscada erruca
 

Similar a All girlhacknight intro to rails

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsanides
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & CucumberUdaya Kiran
 
Rails
RailsRails
RailsSHC
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Heng-Yi Wu
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction Tran Hung
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Maurício Linhares
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialKaty Slemon
 
Building Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkBuilding Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkEdureka!
 

Similar a All girlhacknight intro to rails (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Create a new project in ROR
Create a new project in RORCreate a new project in ROR
Create a new project in ROR
 
rails.html
rails.htmlrails.html
rails.html
 
rails.html
rails.htmlrails.html
rails.html
 
Dev streams2
Dev streams2Dev streams2
Dev streams2
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber       Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
Behavioural Testing Ruby/Rails Apps @ Scale - Rspec & Cucumber
 
Rails
RailsRails
Rails
 
Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102Ruby on Rails Kickstart 101 & 102
Ruby on Rails Kickstart 101 & 102
 
Ruby on Rails introduction
Ruby on Rails introduction Ruby on Rails introduction
Ruby on Rails introduction
 
Aspose pdf
Aspose pdfAspose pdf
Aspose pdf
 
Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10Deploying your rails application to a clean ubuntu 10
Deploying your rails application to a clean ubuntu 10
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorial
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Rspec
RspecRspec
Rspec
 
Ruby On Rails Starter Kit
Ruby On Rails Starter KitRuby On Rails Starter Kit
Ruby On Rails Starter Kit
 
Rails onCpanel
Rails onCpanelRails onCpanel
Rails onCpanel
 
ragi_tutorial_v1
ragi_tutorial_v1ragi_tutorial_v1
ragi_tutorial_v1
 
ragi_tutorial_v1
ragi_tutorial_v1ragi_tutorial_v1
ragi_tutorial_v1
 
Building Application with Ruby On Rails Framework
Building Application with Ruby On Rails FrameworkBuilding Application with Ruby On Rails Framework
Building Application with Ruby On Rails Framework
 

All girlhacknight intro to rails