Forum: Rails France SOLUTION: =?iso-8859-1?q?=28probl=E8mes_d=27accents_avec_Aja

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-02-12 09:29
(Received via mailing list)
La solution est toute simple :  ajouter

       @headers["Content-Type"] = "text/html; charset=utf-8"


exemple:

     def update_positions
       @lists = ...
       @headers["Content-Type"] = "text/html; charset=utf-8"
       render       :partial => 'lists'
     end


Alain
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-02-25 20:46
(Received via mailing list)
> La solution est toute simple :  ajouter
    >       @headers["Content-Type"] = "text/html; charset=utf-8"

Cette solution ne fonctionne pas avec le in_place_editing
(puisque les méthodes qui "fabriquent" les partials sont automatiquement
générées par Rails)


==> La solution: ajouter un filtre dans ApplicationController

    class ApplicationController < ActionController::Base
      ...
      before_filter :set_charset
      def set_charset
          @headers["Content-Type"] = "text/html; charset=iso-8859-1"
      end
      ...
    end
0fd845e7824e980053d4f12c37d89652?d=identicon&s=25 Guillaume "Zifro" DESRAT (Guest)
on 2006-02-26 10:13
(Received via mailing list)
Merci, c'est à savoir !


--
Guillaume "Zifro" DESRAT
http://bientot.un.nouveau.site/zifro/
-- En ce moment : au siège, Les Angles (30 133)




Le 25/02/06, Alain Ravet <arav2132@biz.tiscali.be> a écrit :
This topic is locked and can not be replied to.