I’m getting some weird routing issues.
My extension defines two routes to send requests to a new controller.
It looks like these routes are only recognized about half of the time
(at random).
The other times the url is just sent to the site_controller for ‘normal’
processing.
I guess this means that my laptop is too slow half of the time, and that
the extra routes are not set fast enough…?
It doesn’t seem to matter if i move the extension to the front or the
end of the extension load_order.
Anybody have a clue of what could cause or even better fix this?
Ah, sorry. You might try assert_routing, which does both a generation
and a recognition assertion. Now, I don’t know if it has anything to do
with your problem, but I have found that it’s more reliable to use named
or resource routes in extensions. I’m not sure if this is a Radiant
issue or a Rails issue. Try naming those and see if it becomes more
consistent.
I’m getting some weird routing issues.
My extension defines two routes to send requests to a new controller.
It looks like these routes are only recognized about half of the time
(at random).
The other times the url is just sent to the site_controller
for ‘normal’
processing.
Do you have multiple mongrel/fcgi processes? Is it possible that you
haven’t restarted both of them? (and hence one may not have
read your code).
assert_routing works indeed. The test passes, but i’m still getting the
same results:
app.get(’/en/shop’)
=> 302
app.get(’/en/shop’)
=> 200
app.get(’/en/shop’)
=> 302
app.get(’/en/shop’)
=> 200
app.get(’/en/shop’)
=> 302
app.get(’/en/shop’)
=> 200
app.get(’/en/shop’)
=> 200
app.get(’/en/shop’)
=> 200
This is with a named route.
Daniel; as far as i know i’m not working with multiple mongrel
processes. I’m still working in development mode only, and i haven’t
played with setting up mongrel clusters or anything…
I’m building a rake task to pull all my data from my production db
(MySql) to my development db (SQLite). It works great pulling in that
direction, but when I go to reverse the process, it fails. It has to
do with my plugin that uses attachment_fu.
Basically, I have a model Asset that uses ‘has_attachment’. This is
the code that doesn’t work:
“asset”.classify.constantize
This is the error:
NoMethodError: undefined method `has_attachment’ for Asset:Class
Any ideas what the difference is between production and development
that would cause this to not work? I can run the server in dev mode,
I just can’t run constantize. This error does not happen in the
production environment. I’ve tried changing the contents of config/
environments/development.rb with no success.
freezing didn’t solve the problem, but i’ve found out more about it…
Turning off another extension, i noticed that i had good results more
often.
I then tried the extension on the production server, and it all works
flawless there…
maybe it’s time for a reboot…
Nevermind, I must have had something wacky in my config. I started
fresh with a new 0.6.4 install and brought in my extension, and it
seems fine now. Sorry for the noise on the channel…
-C
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.