Hi I have a sample code that strips html tags from strings. I want to use it all on my models. Where do I have to put it in order to be accessed by all my models? Thanks in advance Onur _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
In app/helpers/application_helper.rb Onur Turgay wrote:> Hi > > I have a sample code that strips html tags from strings. I want to use > it all on my models. Where do I have to put it in order to be accessed > by all my models? > > Thanks in advance > Onur > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
Ooops, never mind, I read views. Maybe in a class in lib. Jos wrote:> In app/helpers/application_helper.rb > > Onur Turgay wrote: > >> Hi >> >> I have a sample code that strips html tags from strings. I want to >> use it all on my models. Where do I have to put it in order to be >> accessed by all my models? >> >> Thanks in advance >> Onur >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
vendor directory is a good candidate. It''s in the search path I guess. On 13.Eki.2005, at 22:03, Onur Turgay wrote:> Hi > > I have a sample code that strips html tags from strings. I want to > use it all on my models. Where do I have to put it in order to be > accessed by all my models? > > Thanks in advance > Onur > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 13-okt-2005, at 21:03, Onur Turgay wrote:> Hi > > I have a sample code that strips html tags from strings. I want to > use it all on my models. Where do I have to put it in order to be > accessed by all my models?Look in Observers documentation - they are the best way to "massage" attributes on your models when the models get saved without polluting your code. -- Julian "Julik" Tarkhanov