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


Comments


You need to login to view comments.