Closed jarl-dk closed 12 years ago
So you say this is something that theme_support supports and themes_for_rails doesn't?
In themes_for_rails, using partial, or templates is no different. Both usages follows the same principle: If there's a theme selected, it will try to render the file on that theme folder, but if it can find it, it will try to render it from the global views folder (normally, app/views).
Maybe I am not getting it right, so care to explain me better?
Thanks
I think the issue is this: I have a global view that contains partial rendering like stated above, with theme_support it looks for these partials as it does for views. First in theme specific dirs, then in global dirs. But with themes_for_rails, it seems ilke if it is using a global view, then it sticks to only look in global dirs (not theme specific dirs) for partials (or other render invocations).
Notice that I am upgrading Rails at the same time as replacing theme_support with themes_for_rails, so it may just as well be related to a change in the way Rails does things.
Jarl,
Tfr doesn't do a thing when you call render. The magic happens when you call the theme method. Then is when a new view location is added to the view path.
Can you reproduce it on a simple brand new app?
Lucas Efe
On Jun 8, 2012, at 18:37, Jarl Friisreply@reply.github.com wrote:
I think the issue is this: I have a global view that contains partial rendering like stated above, with theme_support it looks for these partials as it does for views. First in theme specific dirs, then in global dirs. But with themes_for_rails, it seems ilke if it is using a global view, then it sticks to only look in global dirs (not theme specific dirs) for partials (or other render invocations).
Notice that I am upgrading Rails at the same time as replacing theme_support with themes_for_rails, so it may just as well be related to a change in the way Rails does things.
Reply to this email directly or view it on GitHub: https://github.com/lucasefe/themes_for_rails/issues/58#issuecomment-6213657
I'll try out isolate the issue...
OK, I'll take this bug back. My problem is not related to this, but here is the short version. using theme :theme_selector in the class is very different from theme_support. At theme_support (and Rails2), the theme_selector method is invoked just before render. but in themes_for_rails (and Rails3), the theme_selector method is invoked just before the action method is invoked. That is a different because my theme_selector makes a decision based on some instance variables setup in the action method before render is invoked. You can say that the difference is that in theme_support the method is evaluated lazy whereas in themes_for_rails it is evaluated eagerly.
Jarl
OK. The problem was actually the problem mentioned in https://github.com/lucasefe/themes_for_rails/issues/59 Could you please take a look at that. lucasefe, are you on IRC? or is there a mailing list for questions about themes_for_rails
I'll check the other issue.
I am converting my project from Rails 2.3.x to Rails 3.0 I have replaced theme_support with this themes_for_rails gem.
In my views I have <%= render(:partial => 'some_partial' %> and with theme_support that was looking in the theme specific directory for this partial, but using themes_for_rails, that is not the case.
Jarl