ruby on rails - "No route matches" when view an image -


i have file "test.gif" in "/images". in view, using following command view it

<%= image_tag 'test.gif' %> 

which renders

<img src="/images/test.gif" alt="test"> 

but image not displayed. going "src" address, error message:

no route matches [get] "/images/test.gif" 

how solve problem?

edit:

my route.rb:

rails.application.routes.draw   resources :products end 

this should work:

<%= asset_path('test.gif') %> 

Comments