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

Mountable Engine #64

Open
jackbit opened this issue Aug 15, 2012 · 6 comments
Open

Mountable Engine #64

jackbit opened this issue Aug 15, 2012 · 6 comments

Comments

@jackbit
Copy link

jackbit commented Aug 15, 2012

How to implement it on mountable engine? because i tested, it doesnt work. many thanks.

@lucasefe
Copy link
Owner

I never use it that context. Can you provide some context and errors messages? Maybe I can help you.

Lucas Florio
@lucasefe
http://lucasefe.com.ar/

On Wednesday, August 15, 2012 at 12:04 AM, Yacobus Reinhart wrote:

How to implement it on mountable engine? because i tested, it doesnt work. many thanks.


Reply to this email directly or view it on GitHub (#64).

@jackbit
Copy link
Author

jackbit commented Aug 15, 2012

there's no error message, the problem is the routes can't reach view in my engine, here is my engine.rb snipped code:

require 'rubygems'
require 'themes_for_rails'
module Shopping
  class Engine < ::Rails::Engine
    isolate_namespace Shopping
    config.autoload_paths += %W( #{config.root}/lib )
    ...
    ThemesForRails.config do |config|
      config.assets_dir            = 'app/assets/:name'
      config.themes_dir           = 'app/themes'
      config.views_dir              = 'app/themes/:name/views/shopping'
      config.themes_routes_dir = 'assets'
    end
    ...
  end
end

I decided to group view and assets by themes. each time i access the engine view, it could not find view file in app/themes/my_theme/views/shopping, it keeps pointing views to app/views/shopping. any idea?

@lucasefe
Copy link
Owner

Are you sure the ThemesForRails.config block is being executed?

@jasherai
Copy link

You might also want to make sure your engine is loading the themes_for_rails routes too.

@jackbit
Copy link
Author

jackbit commented Aug 16, 2012

Hi All,

I did include themes_for_rails in my engine routes.rb, how i could know the ThemeForRails.config block is executed or not? I have also tested about:

config.theme_for_rails.assets_dir = 'app/assets/:name'
config.theme_for_rails.themes_dir = 'app/themes'
config.theme_for_rails.views_dir = 'app/themes/:name/views/shopping'
config.theme_for_rails.themes_routes_dir = 'assets'

but still can't find my themes location. if i put config.themes_for_rails = 'app/assets/:name', automatically raise an error about can not produce string, doest it means the theme_for_rails configuration executed?

I still have no idea, at the moment i revert back my view to main application.

@jasherai
Copy link

I would try a rake routes in your main app.. if that returns the TFR routes then your engine is loading that route which suggests that TFR is being loaded.

I would also turn off the themes_routes_dir = 'assets' until you have it working as this is meant to work with the asset pipeline which will only muddy things for you right now.

@lucasefe please let us know if I have misunderstood any of this.

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

3 participants