Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Action controller

294 views

Published on

A short 8 minute or less presentation by 3 Boots in Dev Bootcamp(SF), a 9 week intensive to turn us into junior web developers.

http://github.com/Stephenitis
https://github.com/fmackojc
https://github.com/avalon9000

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Action controller

  1. 1. ActionControllerby these guys & galStephen(itis) Fab(ulous) (Toyota)AvalonPhase 3 @devbootcamp Spring 2013Monday, May 13, 13
  2. 2. What is ActionController?MVCMonday, May 13, 13
  3. 3. Like a switchboardoperatorRoutesControllerMonday, May 13, 13
  4. 4. Differences• Route is included and defined• View is defined by user• Manually createdRailsSinatra• Route is not included• Rendered view is defined byconvention• Actions can be automaticallygenerated by scaffoldingMonday, May 13, 13
  5. 5. So where are the routesand views?get ‘/posts’ => post#indexapp/views/posts/index.html.erb/app/config/routes.rbMonday, May 13, 13
  6. 6. Convention overconfiguration• With Sinatra you are free to name anddefine your controller actions/routes• examples:• get “/showindex” or post “/creatething”• “In Rails there should be no guessing to what acontroller action is doing” - ShadiMonday, May 13, 13
  7. 7. CRUD ACTIONS• CREATE• READ• UPDATE• DESTROYMonday, May 13, 13
  8. 8. Controller:light on logicMonday, May 13, 13
  9. 9. READMonday, May 13, 13
  10. 10. CREATEMonday, May 13, 13
  11. 11. UPDATEMonday, May 13, 13
  12. 12. DESTROYMonday, May 13, 13
  13. 13. FiltersMonday, May 13, 13
  14. 14. Some more for youto explore• Sessions• Flashes• Rendering xml and jsonMonday, May 13, 13
  15. 15. Questions?Monday, May 13, 13

×