More simple finder

/ Published in: Rails
Save to your folder(s)

Copy this code and paste it in your HTML
  1. class << ActiveRecord::Base
  2. # Use 'Book[params[:id]]'
  3. # instead of # Let 'Book.find params[:id]'.
  4. alias_method :[], :find
  5. end

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.