Slides

276 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
276
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Slides

  1. 1. Rails ToolsDan Bunkerhttp://www.linkedin.com/in/bunkerdanFriday, May 10, 2013
  2. 2. GemfileFriday, May 10, 2013
  3. 3. Gemfile Keeps track of all dependencies in your projectFriday, May 10, 2013
  4. 4. Gemfile Keeps track of all dependencies in your project Specify alternate gem repositories (like a corporate gem repo)Friday, May 10, 2013
  5. 5. Gemfile Keeps track of all dependencies in your project Specify alternate gem repositories (like a corporate gem repo) Group dependencies by environmentFriday, May 10, 2013
  6. 6.  Add a gem dependency gem‘gem_name’ gem‘gem_name’,‘version’ gem‘gem_name’,‘git_repo’Gemfile Keeps track of all dependencies in your project Specify alternate gem repositories (like a corporate gem repo) Group dependencies by environmentFriday, May 10, 2013
  7. 7. Database Migrations in Depth Keep your database structure in sync in all environments Development (Bleeding Edge) Testing (Close to development or slightly behind) Production (Behind testing and development)Friday, May 10, 2013
  8. 8. Database Migrations in Depth Keep your database structure in sync in all environments Development (Bleeding Edge) Testing (Close to development or slightly behind) Production (Behind testing and development) schema_migrations table used to track versionsFriday, May 10, 2013
  9. 9. Database Migrations in Depth Keep your database structure in sync in all environments Development (Bleeding Edge) Testing (Close to development or slightly behind) Production (Behind testing and development)DevelopmentVersion 9Apprelease 1.3 schema_migrations table used to track versionsFriday, May 10, 2013
  10. 10. Database Migrations in Depth Keep your database structure in sync in all environments Development (Bleeding Edge) Testing (Close to development or slightly behind) Production (Behind testing and development)TestingVersion 6Apprelease 1.2DevelopmentVersion 9Apprelease 1.3 schema_migrations table used to track versionsFriday, May 10, 2013
  11. 11. Database Migrations in Depth Keep your database structure in sync in all environments Development (Bleeding Edge) Testing (Close to development or slightly behind) Production (Behind testing and development)ProductionVersion 3Apprelease 1.1TestingVersion 6Apprelease 1.2DevelopmentVersion 9Apprelease 1.3 schema_migrations table used to track versionsFriday, May 10, 2013
  12. 12. Data Seeding Load preferences, lookups or other needed dataFriday, May 10, 2013
  13. 13. Data Seeding Load preferences, lookups or other needed data Seed data goes in db/seeds.rbFriday, May 10, 2013
  14. 14. Data Seeding Load preferences, lookups or other needed data Seed data goes in db/seeds.rb rake db:seedFriday, May 10, 2013
  15. 15. Generators OverviewFriday, May 10, 2013
  16. 16. Generators Overview Generators create boilerplate code for pieces of your applicationFriday, May 10, 2013
  17. 17.  Rails provides a set of default generators “rails generate”or“rails generate --help”Generators Overview Generators create boilerplate code for pieces of your applicationFriday, May 10, 2013
  18. 18.  Rails provides a set of default generators “rails generate”or“rails generate --help”Generators Overview Generators create boilerplate code for pieces of your application Gems can provide generators and you can write your own customgeneratorsFriday, May 10, 2013
  19. 19. Generating ModelsFriday, May 10, 2013
  20. 20. Generating Models Model generator creates an ActiveRecord model and a migrationFriday, May 10, 2013
  21. 21. Generating Models Model generator creates an ActiveRecord model and a migration Pass in attributes and their data types to leverage more codegenerationFriday, May 10, 2013
  22. 22. Generating Models Model generator creates an ActiveRecord model and a migration Pass in attributes and their data types to leverage more codegeneration rails generate model model_name attr1:string attr2:integer etc.Friday, May 10, 2013
  23. 23. Generating ControllersFriday, May 10, 2013
  24. 24. Generating Controllers Controller generator will create a controller and folder stubs for its viewsFriday, May 10, 2013
  25. 25. Generating Controllers Controller generator will create a controller and folder stubs for its views Pass in actions to have the generator create view stub files for the actionsFriday, May 10, 2013
  26. 26. Generating Controllers Controller generator will create a controller and folder stubs for its views Pass in actions to have the generator create view stub files for the actions rails generate controller contr_name action1 action 2Friday, May 10, 2013
  27. 27. Rails Console OverviewFriday, May 10, 2013
  28. 28. Rails Console Overview Interactive interpreter with your rails project loadedFriday, May 10, 2013
  29. 29. Rails Console Overview Interactive interpreter with your rails project loaded Good way to become familiar with code or features or to debugFriday, May 10, 2013
  30. 30. Rails Console Overview Interactive interpreter with your rails project loaded Start the rails console with the following command rails console rails console production Good way to become familiar with code or features or to debugFriday, May 10, 2013
  31. 31. Rails DB ConsoleFriday, May 10, 2013
  32. 32. Rails DB Console A wrapper around your database consoleFriday, May 10, 2013
  33. 33. Rails DB Console A wrapper around your database console An easy way to deal with MySQL, PostgreSQL and SQLiteFriday, May 10, 2013
  34. 34. Rails DB Console A wrapper around your database console Start the rails db console with the following command rails dbconsole rails dbconsole production -p An easy way to deal with MySQL, PostgreSQL and SQLiteFriday, May 10, 2013
  35. 35. Other Rake TasksFriday, May 10, 2013
  36. 36. Other Rake Tasks rake aboutFriday, May 10, 2013
  37. 37. Other Rake Tasks rake about rake statsFriday, May 10, 2013
  38. 38. Other Rake Tasks rake about rake stats rake testFriday, May 10, 2013
  39. 39. Asset Pipeline OverviewFriday, May 10, 2013
  40. 40. Asset Pipeline Overview Framework for images, JS and CSS resourcesFriday, May 10, 2013
  41. 41. Asset Pipeline Overview Framework for images, JS and CSS resources Rails asset pipeline will auto minify and compress JS and CSSFriday, May 10, 2013
  42. 42. Asset Pipeline Overview Framework for images, JS and CSS resources Rails asset pipeline will auto minify and compress JS and CSS Asset pipeline supports enhanced languages such as CoffeeScript andSASSFriday, May 10, 2013
  43. 43. SummaryFriday, May 10, 2013
  44. 44. Summary Gemfiles and dependenciesFriday, May 10, 2013
  45. 45. Summary Gemfiles and dependencies Database MigrationsFriday, May 10, 2013
  46. 46. Summary Gemfiles and dependencies Database Migrations Data seedingFriday, May 10, 2013
  47. 47. Summary Gemfiles and dependencies Database Migrations Data seeding Generators overview - Model, ControllerFriday, May 10, 2013
  48. 48. Summary Gemfiles and dependencies Database Migrations Data seeding Generators overview - Model, Controller rails console and rails dbconsoleFriday, May 10, 2013
  49. 49. Summary Gemfiles and dependencies Database Migrations Data seeding Generators overview - Model, Controller rails console and rails dbconsole Other rake tasksFriday, May 10, 2013
  50. 50. Summary Gemfiles and dependencies Database Migrations Data seeding Generators overview - Model, Controller rails console and rails dbconsole Other rake tasks Asset pipelineFriday, May 10, 2013

×