• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Rails missing features

Rails missing features



Our presentation on Israel Rails Conference 2012. Boris talking about what stuff would be nice to see added to next versions of Rails

Our presentation on Israel Rails Conference 2012. Boris talking about what stuff would be nice to see added to next versions of Rails



Total Views
Views on SlideShare
Embed Views



4 Embeds 566

http://astrails.com 480
http://astrails.dev 64
http://feeds.feedburner.com 15
http://boarddash.com 7



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Rails missing features Rails missing features Presentation Transcript

    • Rails Missing Features We dont have all the answers but we definitely have some questions. Boris Nadion @borisnadion
    • Boris Nadiondeveloping software since early 90th working with Rails since 2005 partner at Astrails
    • the greatest thing
    • programmer happiness
    • beautiful code
    • testing
    • communitythe best developers community in the world
    • high quality code the community usually produces
    • opinionated
    • saves timenot making the same decisions over and over again
    • name tables
    • name controllers
    • put source files
    • test the code
    • queue Rails 4
    • etc
    • save time
    • http://www.flickr.com/photos/genista/929340935/
    • decisions
    • “static” pagesPrivacy Policy, Terms of Services, About Us, etc
    • not static at allcustomers what to change them from time to time
    • I don’t
    • basic CMSnot a full featured monster
    • too many choices
    • High Voltage Rails Engine for static pageshttps://github.com/thoughtbot/high_voltage
    • Refinery CMSAn open source Ruby on Rails content management system https://github.com/refinery/refinerycms
    • BrowserCMS Humane Content Management for Railshttps://github.com/browsermedia/browsercms
    • ComfortableMexicanSofa Rails 3 CMS Engine https://github.com/comfy/comfortable-mexican-sofa
    • another ~20 projects worth mentioning
    • it shouldn’t be a part of the framework!
    • why?
    • ERB
    • HAML
    • choiceERB is a default
    • i18nkeeps the texts in separate YAML files
    • textile or markdown
    • basic CMS
    • CORSCross-origin resource sharing
    • server:http://api.service.com AJAX calls client: http://example.com
    • Access-Control-Allow-Origin
    • Rack CORS Middleware https://github.com/cyu/rack-cors
    • JSON serialization
    • business logic should be in a model
    • as_json
    • 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) endend# controllerdef index render(json: collection.to_json(short: true))end
    • representation should be in a view
    • Jbuilderhttps://github.com/rails/jbuilder
    • JSON Builderhttps://github.com/dewski/json_builder
    • class MeaningsController < InheritedResources::Base respond_to :json actions :indexend# app/views/meanings/index.json.json_buildermeanings collection do |meaning| id meaning.id name meaning.nameend
    • think
    • user authentication
    • OmniAuthhttps://github.com/intridea/omniauth
    • Devisehttps://github.com/plataformatec/devise
    • standard de facto
    • real time web server push
    • Push Technologies Overviewhttp://astrails.com/blog/2012/10/2/devcon-2012-real-time-web-slides
    • dumb serverno business logic, no persistence, direct relay
    • notify push serverRails push server create/update content send updatesclient client client client client client
    • hosted solutionspusher, pubnub, hydna, and others
    • channels and messages
    • 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("weve got a message", JSON.parse(message)) }});
    • config.push = :pubnubconfig.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);});
    • pagination
    • will_paginate vs. Kaminari
    • infinite scroll
    • abstraction
    • a part of the framework
    • save a lot of time to spend it on...
    • http://www.flickr.com/photos/grandvelasrivieramaya/3179390917/
    • http://www.flickr.com/photos/cobalt/6162053776/
    • Thank you!Slides and video will be published at http://astrails.com/blog Boris Nadion @borisnadion