If I have the following:
autocomplete_for :project, :code do
self.project = self.site.projects.find_by_code @project_code.strip!
end
I need to explicitly strip @project_code in order to prevent incorrect matches due to extraneous whitespace. Would be more DRY if the generated instance variable was stripped when initialized.
If I have the following:
I need to explicitly strip @project_code in order to prevent incorrect matches due to extraneous whitespace. Would be more DRY if the generated instance variable was stripped when initialized.