Archive for February, 2011
ActiveRecord callbacks and destructive methods
Recently I added search functionality to my application. I implemented a search controller and model. An issue I faced was manipulating the search keywords entered by the user so the search query worked properly. I ended up doing the following: search.rb class Search < ActiveRecord::Base belongs_to :user attr_accessible :keywords, :category, :user validates_presence_of :keywords [...]