Ruby5をひたすら翻訳する日記

海外で働きたい欲が高まった海山はついに強硬手段に出た。自分だけのためにRuby5(http://ruby5.envylabs.com/)翻訳し続けます。おかしなところは、適宜指摘大歓迎です!><

Episode #251 - March 2nd, 2012

Wizard-ify Your Rails Controllers with Wicked

https://github.com/schneems/wicked

  • controllerに段階的な処理を書ける

class AfterSignupController < ApplicationController
    include Wicked::Wizard

    steps :confirm_password, :confirm_profile, :find_friends

    def show
      @user = current_user
      case step
      when :find_friends
        @friends = @user.find_friends
      end
      render_wizard
    end

Edge Rails: PATCH is the new primary HTTP method for updates

http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/

  • Rails4.0では、何かupdateする時に、HTTPのPATCHメソッドを使うことになりそう。
  • ブラウザの対応状況
    • hiddenフィールドの時に、"_メソッド名"を利用するとPATCHリクエストに自動的に変換してくれる??
      • これはブラウザによって対応状況が異なる
  • サーバーの方は大丈夫みたい

The Great Ruby Shootout

http://etehtsea.me/the-great-ruby-shootout
色んなRubyベンチマーク結果のブログ記事

  • MRI, Rubinius, JRubyなどなどについて載っている
  • コンパイラLLVM4.2を使ったほうが20%速かったとか


残りの分間に合わなかった…
明日からまた約1週間行ってきます!