Open jarl-dk opened 12 years ago
Jarl, thanks fo the detailed response.
So you are calling the :theme method from the view? What are you trying to achieve? Hit me on freenode, #rubysur.
Btw, you can declare the :theme method as a helper_method and have it available on the view (if that's what you want) without having to touch the TFR codebase.
OK, I'll try to catch you later on IRC, what nick?
lucasefe
On Thu, Jun 14, 2012 at 9:54 AM, Jarl Friis < reply@reply.github.com
wrote:
OK, I'll try to catch you later on IRC, what nick?
Reply to this email directly or view it on GitHub: https://github.com/lucasefe/themes_for_rails/issues/59#issuecomment-6327242
Ok, this is valid issue. I'll start working on fix. Good catch.
I have theme_resolver method like this:
The first time
theme_resolver
is invoked is prior to the action, so it returns nil. Next time it is invoked is at the time of render, at this time it is invoked as a method included in the myActionView
view. At this time the line (in common_methods.rb:12)returns nil, because
self.respond_to?(@theme_name, true)
evaluates to false because the theme_resolver is not member of the view (it's a member of the controller) so thetheme_resolver
is not invoked at all. I suggest changing that line to something likeor something like that.
Meanwhile I have to invoke (as a workaround)
to set and cache the theme_name before my action method reach the render code.
Jarl