On Dec 22, 4:24 pm, Mauro <[email protected]> wrote:
> On 22 December 2010 17:22, Colin Law <[email protected]> wrote:
>
> > On 22 December 2010 15:56, Mauro <[email protected]> wrote:
> >> For all my applicatino I use layout A.
> >> In this layout I have <%= javascript_include_tag 'application.js' %>
> >> and, in this javascript I have some code that I want to execute on all
> >> pages exept one.
> >> How can I exclude this javascript only for one page?
>
> > You could extract that code to a separate .js file and have a separate
> > layout for that page that does not include the new js file.
>
> But I have to duplicate the layout code only to not include a .js?
> All the pages have the same layout.

You could stick <%= yield :extra_js %> in the head section of the
layout and then use content_for :extra_js with the include for the
extra javascript file

Fred

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to