Successfully reported this slideshow.
Your SlideShare is downloading. ×

Rails missing features

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Rails Missing Features
      We don't have all the answers
  but we definitely have some questions.




                   ...

YouTube videos are no longer supported on SlideShare

View original on YouTube

Boris Nadion
developing software since early 90th
   working with Rails since 2005
         partner at Astrails

Check these out next

1 of 73 Ad
Advertisement

More Related Content

Slideshows for you (20)

Advertisement

Similar to Rails missing features (20)

Advertisement

Recently uploaded (20)

Rails missing features

  1. 1. Rails Missing Features We don't have all the answers but we definitely have some questions. Boris Nadion @borisnadion
  2. 2. Boris Nadion developing software since early 90th working with Rails since 2005 partner at Astrails
  3. 3. the greatest thing
  4. 4. programmer happiness
  5. 5. beautiful code
  6. 6. testing
  7. 7. community the best developers community in the world
  8. 8. high quality code the community usually produces
  9. 9. opinionated
  10. 10. saves time not making the same decisions over and over again
  11. 11. name tables
  12. 12. name controllers
  13. 13. put source files
  14. 14. test the code
  15. 15. queue Rails 4
  16. 16. etc
  17. 17. save time
  18. 18. http://www.flickr.com/photos/genista/929340935/
  19. 19. decisions
  20. 20. “static” pages Privacy Policy, Terms of Services, About Us, etc
  21. 21. not static at all customers what to change them from time to time
  22. 22. I don’t
  23. 23. basic CMS not a full featured monster
  24. 24. too many choices
  25. 25. High Voltage Rails Engine for static pages https://github.com/thoughtbot/high_voltage
  26. 26. Refinery CMS An open source Ruby on Rails content management system https://github.com/refinery/refinerycms
  27. 27. BrowserCMS Humane Content Management for Rails https://github.com/browsermedia/browsercms
  28. 28. ComfortableMexicanSofa Rails 3 CMS Engine https://github.com/comfy/comfortable-mexican-sofa
  29. 29. another ~20 projects worth mentioning
  30. 30. it shouldn’t be a part of the framework!
  31. 31. why?
  32. 32. ERB
  33. 33. HAML
  34. 34. choice ERB is a default
  35. 35. i18n keeps the texts in separate YAML files
  36. 36. textile or markdown
  37. 37. basic CMS
  38. 38. CORS Cross-origin resource sharing
  39. 39. server: http://api.service.com AJAX calls client: http://example.com
  40. 40. Access-Control-Allow-Origin
  41. 41. Rack CORS Middleware https://github.com/cyu/rack-cors
  42. 42. JSON serialization
  43. 43. business logic should be in a model
  44. 44. as_json
  45. 45. class Meaning < ActiveRecord::Base has_many :senses AS_JSON = { only: [:id, :name], methods: [:voiceover_url], include: {senses: Sense::AS_JSON} } AS_JSON_SHORT = {only: [:id, :name]} def as_json(opts = {}) super opts.merge(opts.delete(:short) ? AS_JSON_SHORT : AS_JSON) end end # controller def index render(json: collection.to_json(short: true)) end
  46. 46. representation should be in a view
  47. 47. Jbuilder https://github.com/rails/jbuilder
  48. 48. JSON Builder https://github.com/dewski/json_builder
  49. 49. class MeaningsController < InheritedResources::Base respond_to :json actions :index end # app/views/meanings/index.json.json_builder meanings collection do |meaning| id meaning.id name meaning.name end
  50. 50. think
  51. 51. user authentication
  52. 52. OmniAuth https://github.com/intridea/omniauth
  53. 53. Devise https://github.com/plataformatec/devise
  54. 54. standard de facto
  55. 55. real time web server push
  56. 56. Push Technologies Overview http://astrails.com/blog/2012/10/2/devcon-2012-real-time-web-slides
  57. 57. dumb server no business logic, no persistence, direct relay
  58. 58. notify push server Rails push server create/update content send updates client client client client client client
  59. 59. hosted solutions pusher, pubnub, hydna, and others
  60. 60. channels and messages
  61. 61. pubnub = Pubnub.new(... keys and auth...) pubnub.publish( message: "some-message, preferably JSON", channel: "some-channel-name, preferably secret token" ) # somewhere on a client side ... PUBNUB.subscribe({ channel : "some-channel-name, preferably secret token", callback : function(message) { console.log("we've got a message", JSON.parse(message)) } });
  62. 62. config.push = :pubnub config.push_auth = {...} Rails.push.publish(channel: @post.token, json: @comment) # somewhere on a client side ... $(window).on("push", function(e, channel_name, message) { console.log("new message", channel_name, message); });
  63. 63. pagination
  64. 64. will_paginate vs. Kaminari
  65. 65. infinite scroll
  66. 66. abstraction
  67. 67. a part of the framework
  68. 68. save a lot of time to spend it on...
  69. 69. http://www.flickr.com/photos/grandvelasrivieramaya/3179390917/
  70. 70. http://www.flickr.com/photos/cobalt/6162053776/
  71. 71. Thank you! Slides and video will be published at http://astrails.com/blog Boris Nadion @borisnadion

×