Discussion:
Locomotive caches controller
Johan Lavenius
2007-09-24 12:17:20 UTC
Permalink
Locomotive seems to cache my controller and changes in the controller
code doesnt
affect the output without me restarting the app (sometimes i need to restart
the app with a new port for it to update). Changes to the view is instant.
Another problem is with a view:

View:
Hello
<%= link_to "Testlink", :controller => "start", :action => "index" %>

Output: (Not interpret as html by the browser) Why?

Hello

<a href="/start">Testlink</a>




Using: Locomotive 2.0.8 and RMagick Rails Mar 2007 bundle

//Johan
Alex Satrapa
2007-09-24 23:23:42 UTC
Permalink
Post by Johan Lavenius
Locomotive seems to cache my controller and changes in the
controller code doesnt affect the output without me restarting the
app (sometimes i need to restart the app with a new port for it to
update). Changes to the view is instant.
That's what I would expect - the built-in web server is loading the
Ruby modules on demand, but only parsing the HTML as it's sending the
output to the client. Once the Ruby modules are loaded, they're stuck
in memory.

I think you can get away with "require_dependency" instead of
"require" in some places, but there is a lot of stuff in Rails that
is autoloaded which you have no control over.
...
Post by Johan Lavenius
Output: (Not interpret as html by the browser) Why?
What other HTML is around it? Have you run the complete output
through an HTML validator? I wonder if you've somehow got the output
into plain text mode instead of sending text/html.

Alex

Loading...