24 Feb 10:57
Problème jRails sortable_element
Attention si vous utilisez le plugin jRails qui permet d’avoir les helpers ajax en jQuery le sortable_element ne fonctionne pas.
Solution :
A la ligne 363 de jrails.rb dans le rép vendor/plugins… remplacer :
options[:with] ||= “#{JQUERY_VAR}(this).sortable(‘serialize’,{key:‘#{element_id}’})”
par :
options[:with] ||= “#{JQUERY_VAR}(this).sortable(‘serialize’,{key:‘#{element_id}[]’})”
sinon votre helper ne passera qu’un id et non pas un tableau.
24 Feb 10:57
Convertir ses fichiers erb en haml rapidement
Un petit script bien pratique pour les fans d’haml.
class ToHaml
def initialize(path)
@path = path
end
end
path = File.join(File.dirname(FILE), ‘app’, ‘views’)
ToHaml.new(path).convert!
A placer dans un fichier à la racine du projet pour l’executer.
