I''m putting together a layout where the only difference between views is the <script> tags in the <head>. I tried using partials to abstract out the script tags, but it seems like they''re not being treated as HTML, as they''re being escaped before being written to the view. Why is this? ___________________ Ben Jackson Diretor de Desenvolvimento ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org http://www.incomumdesign.com
Ben, you''re not doing <%=h render_partial... are you? spot the ''h'' in there... Trevor On 10-Jun-05, at 7:59 AM, Ben Jackson wrote:> I''m putting together a layout where the only difference between views > is the <script> tags in the <head>. I tried using partials to abstract > out the script tags, but it seems like they''re not being treated as > HTML, as they''re being escaped before being written to the view. Why > is this? > ___________________ > Ben Jackson > Diretor de Desenvolvimento > > ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > http://www.incomumdesign.com > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
put this in your layout : <script> <%= @content_for_script %> </script> and this in your view: <% content_for(''script'') do %> alert(''hello!''); <% end %> On 6/10/05, Ben Jackson <ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org> wrote:> I''m putting together a layout where the only difference between views > is the <script> tags in the <head>. I tried using partials to abstract > out the script tags, but it seems like they''re not being treated as > HTML, as they''re being escaped before being written to the view. Why is > this? > ___________________ > Ben Jackson > Diretor de Desenvolvimento > > ben-p14LI7ZcAE/pVLaUnt/cCQC/G2K4zDHf@public.gmane.org > http://www.incomumdesign.com > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog