Vous pouvez créer un nouveau filtre pour les images, et ajoutez le filtre dans un initialiseur, après avoir mis la gemme auto_html. Le filtre peut se présenter comme suit:
AutoHtml.add_filter(:sized_image).with(:width => INSERT_SOME_DEFAULT_HERE, :height => INSERT_SOME_DEFAULT_HERE) do |text, options|
text.gsub(/http:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
width = options[:width]
height= options[:height]
%|<img src="#{match}" alt="" width="#{width}" height="#{height}" />|
end
end
Ceci est non testé, comme je l'ai pas encore accès au terminal, mais doit travailler ou obtenir au moins vous l'avez fait dans la bonne direction. Bonne chance!
merci beaucoup ça fonctionne! – tabaluga