Skip to content

Instantly share code, notes, and snippets.

@Bill
Created September 18, 2008 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bill/11486 to your computer and use it in GitHub Desktop.
Save Bill/11486 to your computer and use it in GitHub Desktop.
class FooController < ApplicationController
before_filter :include_scripts
protected
def include_scripts
include_tags = render_to_string( :partial => 'editor/head_elements' )
# um, see e.g. layout.rb line 254 in Rails 2.1.0. content_for variables have the form @content_for_<name>
@template.instance_variable_set("@content_for_head", include_tags )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment