Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "themes" (feature request or question how to do that) #11

Closed
leandrocg opened this issue Nov 27, 2012 · 1 comment
Closed

Using "themes" (feature request or question how to do that) #11

leandrocg opened this issue Nov 27, 2012 · 1 comment

Comments

@leandrocg
Copy link

Firstly, congratulations for this initiative.

Is there a way for scoping template model like the following?

class ApplicationController < ActionController::Base
  before_filter :database_template

  def database_template
    prepend_view_path DatabaseTemplate.where(theme: current_theme).resolver
  end

  def current_theme
    # find theme picked by user
  end
end

Thanks!

@leandrocg
Copy link
Author

I've done the following:

class DatabaseTemplate < ActiveRecord::Base
  store_templates

  def self.resolver(options={})
    Panoramic::Resolver.using scoped, options
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants