For those of you who have solved the learning hurdle of rails deployment, all I can say is congratulations! I’m struggling, frustrated that my app, which runs so well on my linux box, generates such odd errors on my vps and completely fails to do anything. For example, at the moment my production.log file has the error:
ActionController::RoutingError (No route matches "/favicon.ico" with {:method=>:get}):
Sometimes instead of favicon it complains of robots.txt. Well, nowhere in my code – that I can find – it there any refernece to either, yet here I sit, looking at a blank screen, and trading the occasional email with the sysadmin.
For those of you who have solved the learning hurdle of rails deployment,
all I can say is congratulations! I'm struggling, frustrated that my app,
which runs so well on my linux box, generates such odd errors on my vps and
completely fails to do anything. For example, at the moment my
production.log file has the error:
ActionController::RoutingError \(No route matches "/favicon\.ico" with
{:method=>:get}):
That particular error is a red herring - it means someone requested a
file that doesn't exist. A favicon is the icon that appears to the
left of the url bar in the browser, when a browser visits your site it
will automatically request that file. Similarly, robots.txt contains
instructions for bots crawling your site, so they automatically
request it. Neither of these two will actually impact your site. What
else is happening?
Fred,
Thanks. Yes, I know all of that, so that is why these errors seem so
odd.
Actually, the errors make a lot of sense. Browsers tend to request
favicon.ico automatically. If it's not there, no harm done. Likewise
with robots.txt being automatically requested by search crawlers. In
neither case should you worry in the slightest.
On Fri, Jan 7, 2011 at 4:33 AM, Frederick Cheung
<frederick.cheung@gmail.com
I'm working with an API that returns me a collection of locations as a hash. I could just display things like @places[:feature][:name] etc, but that seems pretty ugly (and brittle) to me.
So I'm tempted to have a non-AR, non-persisted model class called Place.
If I was writing this in Groovy I'd probably create a static method on Place - maybe loadPlaces(hash: placeHash) that would return a collection of place objects.
What would be the idiomatic Rails/Ruby approach to something like this? Would I just change the capitalization to have a Place.load_places(place_hash) method or would there be a more Ruby/Rails way of solving the problem?
I'm working with an API that returns me a collection of locations as a hash. I could just display things like @places[:feature][:name] etc, but that seems pretty ugly (and brittle) to me.
I don't quite understand what you mean by a collection of locations.
Is that an array of hashes? Can you explain the data structure in
more detail?
So I'm tempted to have a non-AR, non-persisted model class called Place.
If I was writing this in Groovy I'd probably create a static method on Place - maybe loadPlaces(hash: placeHash) that would return a collection of place objects.
What would be the idiomatic Rails/Ruby approach to something like this? Would I just change the capitalization to have a Place.load_places(place_hash) method or would there be a more Ruby/Rails way of solving the problem?