Pro Yearly is on sale from $80 to $50! »

Slim Ruby on Rails: Controllers & Middlewares

Slim Ruby on Rails: Controllers & Middlewares

794f638b6f7f5132d5a13230e61c9db2?s=128

Krzysztof Wawer

June 21, 2017
Tweet

Transcript

  1. Slim Ruby on Rails: Controllers & Middlewares Krzysztof Wawer

  2. Request https://medium.com/@christemple/what-is-rack-in-ruby-7e0615f1d9b6

  3. Request Rack App Middlewares log auth cache HTTP Request HTTP

    Response
  4. Middleware

  5. Rack Middleware http://railscasts.com/episodes/151-rack-middleware

  6. Ruby on Rails Middleware stack $ rails new app $

    rails new app --api $ rake middleware http://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack
  7. Ruby on Rails Middleware stack use Rack::MethodOverride use Sprockets::Rails::QuietAssets use

    WebConsole::Middleware use ActionDispatch::Cookies use ActionDispatch::Session::CookieStore use ActionDispatch::Flash http://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack
  8. RoR Middlewares problem https://github.com/rails/rails/blob/master/railties/lib/rails/application/default_middleware_stack.rb

  9. http://paulserraino.com/rails/2016/02/29/rails-mountable-engines.html Rails Engines

  10. Ruby on Rails Engine http://tech.taskrabbit.com/blog/2014/02/11/rails-4-engines/

  11. Controller

  12. None
  13. None
  14. ActionController::Base http://api.rubyonrails.org/classes/ActionController/Base.html

  15. ActionController::API http://api.rubyonrails.org/classes/ActionController/API.html

  16. ActionController::Metal http://api.rubyonrails.org/classes/ActionController/Metal.html

  17. ActionController::API http://api.rubyonrails.org/classes/ActionController/API.html

  18. Why ?

  19. • Strong Parameters • Params Wrapper

  20. • Strong Parameters • Params Wrapper Mapping

  21. Mapping - missing part Nested Attributes - revealing structure