CCH wrote ...

> This piece of code works in Rails 1.2
> <a><img src="/images/crm.jpg"></a>
> 
> But crashes in Rails 2.2.3
> 
> Processing ApplicationController#index (for 127.0.0.1 at 2009-08-21
> 10:22:23) [GET]
> 
> ActionController::RoutingError (No route matches "/images/crm.jpg"
> with {:method=>:get}):
>   -e:2:in `load'
>   -e:2
> 
> Rendering rescues/layout (not_found)
> 
> How can I configure the correct route in routes.rb ?

You shouldn't need to change anything in routes.rb.

Where is that piece of code and what URL are you hitting?

I tried adding something similar in one of my view templates and I do
not get any routing errors, either for a file that exists or one that
does not. Make sure that RAILS_ROOT/public/images/crm.jpg exists, but
even if it doesn't you shouldn't be getting a routing error.

You could always try using <%= image_tag("crm.jpg") %> instead of
hard-coding the path, but I wouldn't expect that to make any difference
unless you're running your app from a subdirectory.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to