tags:

views:

38

answers:

1

Is there any way to suppress the default js and css loaded by application.html.erb on a view by view basis? I'm finding it incredibly difficult to manage a global css and js includes configuration when certain views need different js libraries that for some reason seem to be conflicting with one another. For example, I might want jquery 1.3 for one view and 1.4.2 for another. I don't necessarily want to have to have an include for every view (I do want to have a global site-wide default), but I would also like to be able to override those for any view I want. Thanks!

A: 
# Renders the template for the action "long_goal" within the current controller,
# but with a custom layout
render :action => "long_goal", :layout => "spectacular"

See the documentation for render

So you could do this, for example:

def show
  respond_to do |wants|
    wants.html { render :action => 'show', :layout => 'other_layout' }
  end
end

But this is just a hacky bandaid. You should look into why the two versions of jQuery are conflicting.

rspeicher
ok, thanks!! i'm definitely looking into the issue with jquery.
dt