Rails 3.1 action caching and render layout false

Today I ran into one of the weirdest issues I ever ran into the past 6 years.

In Alchemy CMS we use rails action caching to cache the content of pages. This worked fine for rails 2.x. But now we finally made the switch to rails 3.1 we had an weird issue with action caching.

Although we passed :layout => false to caches_action the whole layout was always cached together with the action. After nearly 5 hours of debugging and swearing I found the solution.

In the show action (the action we are caching, obviously) we call

render :layout => layout_for_page

(layout_for_page returns either application.html.erb if present, or alchemy/pages.html.erb if not).

After removing this everything worked fine. But how do we ensure our feature is still working?

I use the layout class method and pass the method name as symbol:

layout :layout_for_page

Rails evaluates this method and uses the return value as layout.

Veröffentlicht in Webdevelopment | Getagged , | Kommentieren

Precompile Assets From Rails 3.1 Engines

Today I finally finished the rails 3.1 upgrade for our open source CMS Alchemy.

An issue I ran into was, that while deploying, the assets from inside the engine weren’t precompiled.
Mehr lesen »

Veröffentlicht in Webdevelopment | Getagged , , , , | 2 Kommentare

What people would complain about if OS X Lion would have been the predecessor of OS X Snow Leopard

Lets guess Apple had released OS X Lion before OS X Snow Leopard.

What people would complain about? Mehr lesen »

Veröffentlicht in Allgemein, Unix/Mac/Linux Tips | Getagged , , , , | 1 Kommentar

Safari like focused form elements styled with css3

I like Safaris style of focused form elements.

For those not using Safari (why?) it looks like this:

Safari focused input element

But I also love cross browser styling of form elements like buttons, inputs, selects.

So I simulated the style with CSS3!

Mehr lesen »

Veröffentlicht in Webdevelopment | Getagged , | Kommentieren

HTML5 Forms Placeholder Fallback

Today I made a HTML5 Form with the new cool placeholder feature.

The placeholder feature lets you set a placeholder text for an form input element.

<input type="text" placeholder="Your name" name="name">

See more here

But like often in this shiny new HTML5 world the browser support for HTML5 is limited.

So I wrote a jQuery based Javascript fallback for browsers not supporting this feature.

Mehr lesen »

Veröffentlicht in Webdevelopment | Getagged , , , , | 10 Kommentare

Merging OS X folders via Terminal

Ever ask how to merge folders and it’s contents under Mac OS X like Windows does?

Mehr lesen »

Veröffentlicht in Unix/Mac/Linux Tips | Getagged , , , , | 1 Kommentar

Tastatursteuerung am Mac

Windows kann man komplett mir der Tastatur steuern. Macs nicht.

Falsch!

Mehr lesen »

Veröffentlicht in Unix/Mac/Linux Tips | Getagged , | 1 Kommentar

Migrating a Subversion Repository

Want to switch servers? Want to backup your subversion repository? Then this guide is the right one. Mehr lesen »

Veröffentlicht in Unix/Mac/Linux Tips | Getagged , , | Kommentieren

Configure subversion, apache and mod_dav_svn on debian

This Guide is for installing subversion on a debian (lenny) linux server with mod_dav and mod_dav_svn for the apache2 webserver. You must have root access to your server to follow this guide.

Mehr lesen »

Veröffentlicht in Unix/Mac/Linux Tips | Getagged , , | Kommentieren

Yeah! I am cool.
I develop OpenSource Software ;)

Follow me on:

GitHub Logo