A reference to a controller is also a constant. Everything which
starts with an uppercase letter is in fact a constant.

Hm. Could you give me a backtrace? It seems like it's ActiveSupport's
const_missing or something like that.

You don't really need to read/understand all those comments in the
patch. It's all related to the fact that Tilt defines the template as
a method under the Tilt::CompileSite (which is included in each
request in Camping) so when you call #render it actually calls a
method called #_tilt_ajdbakjasjdbakjsbdk in the background. Calling a
method is way faster than instance_eval, so this gives a significant
speed improvement. The problem by defining the method under
Tilt::CompileSite is that constant lookup is now relative to
Tilt::CompileSite instead of your request. This is what the patch
fixes.

// Magnus Holm



On Wed, Jul 21, 2010 at 22:53, David Susco <[email protected]> wrote:
> Thanks Magnus,
>
> I gave that a shot but I'm still getting an argument error:
>
> Anonymous modules have no name to be referenced by
>
> I'm trying to wrap my mind around what this patch is doing, but I
> don't see the connection between constants and a reference to a
> controller.
>
> Dave
>
> On Wed, Jul 21, 2010 at 3:29 PM, Magnus Holm <[email protected]> wrote:
>> This is a well-known bug in Tilt:
>> http://groups.google.com/group/tiltrb/browse_thread/thread/19fef5370c4d417f
>>
>> The thread includes a quite simple patch for 1.8, and a larger, very
>> hackish patch for 1.8+1.9.
>>
>>
>> // Magnus Holm
>>
>>
>>
>> On Wed, Jul 21, 2010 at 21:05, David Susco <[email protected]> wrote:
>>> When using Tilt for views I need to completely specify the controller
>>> within the template file.
>>>
>>> For example, in a Markaby view I can do this:
>>>
>>> URL(LogIn)
>>>
>>> But in a template file I have to do this:
>>>
>>> URL(MyApp::Controllers::LogIn)
>>>
>>> Is there anyway around this?
>>>
>>> --
>>> Dave
>>> _______________________________________________
>>> Camping-list mailing list
>>> [email protected]
>>> http://rubyforge.org/mailman/listinfo/camping-list
>>>
>> _______________________________________________
>> Camping-list mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/camping-list
>>
>
>
>
> --
> Dave
> _______________________________________________
> Camping-list mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/camping-list
>
_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to