SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Web Programming with
        Rails
• Why Rails?
• Rails overview
• Dealing with Data
• Live Console and Testing
• About the class and other resources
Why Rails?
A Philly Moment
Rails Overview
• Developed for BaseCamp by 37 signals
• DSL for web applications
Controller
Controller
Controller




Model
Controller




Model
Controller




Model                View
Controller




Model                View
Convention over
 Configuration
GET /comments

CommentsController#index

 views/comments/index.html.erb
GET /comments/4

CommentsController#show

views/comments/show.html.erb
GET /comments/4.js

CommentsController#show

views/comments/show.js.erb
Data
More Convention over
   Configuration
Super simple
•C   reate


•R   etreive


•U   pdate


•D   elete
Comment.create(:author => "mat")




INSERT INTO comments
(author) VALUES('mat');
Comment.find_by_author("mat")




SELECT * FROM comments
WHERE author = 'mat';
c = Comment.find(1)
c.update_attribute(:author, "mat")




SELECT * FROM comments WHERE id = 1;
UPDATE comments SET author = 'mat' WHERE
id = 1;
c = Comment.find(1)
c.destroy




SELECT * FROM comments WHERE id = 1;
DELETE FROM comments WHERE id = 1;
More data hotness


• Schema management
• Works the same across databases
rails console


• Try out code live
• Inspect your data using code
testing


• Built into rails
• Strong testing culture built into ruby
About the Class
Mat Schaffer
 mat@mashion.net
   @matschaffer
  matschaffer.com
Trotter
  Cashion
trotter@mashion.net
      @cashion
 trottercashion.com
Ryan Findley
ryan@neomindstudio.com
     @neomindryan
    neomindlabs.com
Rough Plan: Build stuff

• Week 1: Basic data and views
• Week 2: User stories and testing
• Week 3: Plugins
• Week 4: Deployment and Scaling
Logistics
Homework submission via github:

github.com


And heroku:
heroku.com

Working in pairs is encouraged!
Get help on the mailing list:
groups.google.com/group/
 upenn-on-rails


Or IRC:
irc.freenode.net#philly.rb
Recommendations

• TryRuby.org
• RailsForZombies.com
• Agile Web Development with Rails
• Why’s Poignant Guide to Ruby
What do you want to
      build?
Prerequisite:
          Accounts

• https://github.com/signup/free
• https://api.heroku.com/signup
Prerequisite:
            Setup
• Mac needs Xcode -
  http://developer.apple.com/tools/xcode
• Windows maybe http://rubyinstaller.org/
• RVM - rvm.beginrescueend.com
• Or just use Ubuntu on VirtualBox
Test your install

rails new mysite
cd mysite
rails server
(open a browser to http://localhost:3000)
UPenn on Rails intro

Weitere ähnliche Inhalte

Was ist angesagt?

Build your datatypes
Build your datatypesBuild your datatypes
Build your datatypes
Edi Modrić
 
Python to go
Python to goPython to go
Python to go
Weng Wei
 

Was ist angesagt? (19)

Build your datatypes
Build your datatypesBuild your datatypes
Build your datatypes
 
Python to go
Python to goPython to go
Python to go
 
Different ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail BortnykDifferent ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail Bortnyk
 
Rails I18n From The Trenches
Rails I18n From The TrenchesRails I18n From The Trenches
Rails I18n From The Trenches
 
GitHub as a Landing Page
GitHub as a Landing Page GitHub as a Landing Page
GitHub as a Landing Page
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
Railsフロントエンドの modernizeにおける一事例 ~decaffeinateからES2015移行まで~
Railsフロントエンドの modernizeにおける一事例 ~decaffeinateからES2015移行まで~Railsフロントエンドの modernizeにおける一事例 ~decaffeinateからES2015移行まで~
Railsフロントエンドの modernizeにおける一事例 ~decaffeinateからES2015移行まで~
 
Railsで作るBFFの功罪
Railsで作るBFFの功罪Railsで作るBFFの功罪
Railsで作るBFFの功罪
 
Tips to improve your code review
Tips to improve your code reviewTips to improve your code review
Tips to improve your code review
 
Architecture - why so serious?
Architecture - why so serious?Architecture - why so serious?
Architecture - why so serious?
 
Sinatraで触れる生SQL
Sinatraで触れる生SQLSinatraで触れる生SQL
Sinatraで触れる生SQL
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
 
eazyBI Overview - Embedding Mondrian in other applications
eazyBI Overview - Embedding Mondrian in other applicationseazyBI Overview - Embedding Mondrian in other applications
eazyBI Overview - Embedding Mondrian in other applications
 
Why I don’t want to develop iOS apps in Objective C
Why I don’t want to develop iOS apps in Objective CWhy I don’t want to develop iOS apps in Objective C
Why I don’t want to develop iOS apps in Objective C
 
Craft Beer & Clojure
Craft Beer & ClojureCraft Beer & Clojure
Craft Beer & Clojure
 
Riak at Posterous
Riak at PosterousRiak at Posterous
Riak at Posterous
 
Ruby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCRuby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVC
 
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
Software Design Trilogy Part III - Domain Driven Design for Ruby on Rails App...
 
GraphQL over REST
GraphQL over RESTGraphQL over REST
GraphQL over REST
 

Andere mochten auch (8)

THE SWARM @ Mediamatic, Amsterdam: Mobile Trends for the Culture Sector
THE SWARM @ Mediamatic, Amsterdam: Mobile Trends for the Culture SectorTHE SWARM @ Mediamatic, Amsterdam: Mobile Trends for the Culture Sector
THE SWARM @ Mediamatic, Amsterdam: Mobile Trends for the Culture Sector
 
Vocabulari
VocabulariVocabulari
Vocabulari
 
UPenn on Rails pt 2
UPenn on Rails pt 2UPenn on Rails pt 2
UPenn on Rails pt 2
 
Presentacio1
Presentacio1Presentacio1
Presentacio1
 
Каталог оборудования для бассейнов
Каталог оборудования для бассейновКаталог оборудования для бассейнов
Каталог оборудования для бассейнов
 
USC Annenberg Journalism Director's Forum - Future of Mobile News and Journal...
USC Annenberg Journalism Director's Forum - Future of Mobile News and Journal...USC Annenberg Journalism Director's Forum - Future of Mobile News and Journal...
USC Annenberg Journalism Director's Forum - Future of Mobile News and Journal...
 
Leave Your Phone at Home, THIS is Mobile Media - Edinburgh Interactive Festival
Leave Your Phone at Home, THIS is Mobile Media - Edinburgh Interactive FestivalLeave Your Phone at Home, THIS is Mobile Media - Edinburgh Interactive Festival
Leave Your Phone at Home, THIS is Mobile Media - Edinburgh Interactive Festival
 
Presentacio
PresentacioPresentacio
Presentacio
 

Ähnlich wie UPenn on Rails intro

How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 

Ähnlich wie UPenn on Rails intro (20)

How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Contributing to rails
Contributing to railsContributing to rails
Contributing to rails
 
A Beginner's Guide to Ember
A Beginner's Guide to EmberA Beginner's Guide to Ember
A Beginner's Guide to Ember
 
Behat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdfBehat bdd training (php) course slides pdf
Behat bdd training (php) course slides pdf
 
PHP Framework Battle
PHP Framework BattlePHP Framework Battle
PHP Framework Battle
 
EmberCLI Rails: An Integration Love Story.
EmberCLI Rails: An Integration Love Story.EmberCLI Rails: An Integration Love Story.
EmberCLI Rails: An Integration Love Story.
 
JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails
 
Tooling for the productive front-end developer
Tooling for the productive front-end developerTooling for the productive front-end developer
Tooling for the productive front-end developer
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails Ecosystem
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Riding IronRuby on Rails
Riding IronRuby on RailsRiding IronRuby on Rails
Riding IronRuby on Rails
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
 
Scribe online 03 scribe online cdk and api overview
Scribe online 03   scribe online cdk and api overviewScribe online 03   scribe online cdk and api overview
Scribe online 03 scribe online cdk and api overview
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
 

Mehr von Mat Schaffer

Mehr von Mat Schaffer (8)

chef loves windows
chef loves windowschef loves windows
chef loves windows
 
wwc start-launched
wwc start-launchedwwc start-launched
wwc start-launched
 
PTW Rails Bootcamp
PTW Rails BootcampPTW Rails Bootcamp
PTW Rails Bootcamp
 
Philly rb 2011-04-12 Intro
Philly rb 2011-04-12 IntroPhilly rb 2011-04-12 Intro
Philly rb 2011-04-12 Intro
 
Ruby on the Phone
Ruby on the PhoneRuby on the Phone
Ruby on the Phone
 
2011 02-08 cucumber
2011 02-08 cucumber2011 02-08 cucumber
2011 02-08 cucumber
 
UPenn on Rails pt 1
UPenn on Rails pt 1UPenn on Rails pt 1
UPenn on Rails pt 1
 
Node.js
Node.jsNode.js
Node.js
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

UPenn on Rails intro

Hinweis der Redaktion

  1. \n
  2. \n
  3. What are you interested/concerned about?\n- jobs\n- community involvement\n- notoriety\n- easy\n- fun\n
  4. - BarCamp\n- TEDxPhilly\n- IndyHall\n- Philly.rb\n- Philly Startup Leaders\n- Philly Lambda\n- Hive76\n- Tecnically Philly\n- Philly Tech Week in April\n
  5. - Cake PHP, Symphony?\n- Spring Roo, MVC?\n- Django?\n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. Or no database. Use sqlite to get even your designers up and running quickly.\n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n