Shortcut for find method in rails


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

Put this in environment.rb to use in your whole app or the console


Copy this code and paste it in your HTML
  1. class <<ActiveRecord::Base
  2. alias_method :[], :find
  3. end

URL: http://weblog.jamisbuck.org/2007/4/4/activerecord-base-find-shortcut

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.