Skip to content

Instantly share code, notes, and snippets.

@kiote
Created September 12, 2012 08:52
Show Gist options
  • Select an option

  • Save kiote/3705353 to your computer and use it in GitHub Desktop.

Select an option

Save kiote/3705353 to your computer and use it in GitHub Desktop.
def get_content_blocks
page_name = "#{params[:controller]}_#{params[:action]}"
page = Page.where(name: page_name).first.contents rescue []
page.each { |obj| instance_variable_set("@"+obj.name, obj.body) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment