When I use url_for in an action then I get a correct URL :-
@picture_url = url_for :controller => ''pictures'', :action
=> ''show'', :id
=> @picture.id # ==> http://192.168.1.34:3000/pictures/show/70
But if I generate the URL in the template (which looks neater codewise)
then I get only /controller/action/id :-
<img src="<%= url_for :controller => ''pictures'',
:id=> @picture.id,
:action=> ''show'' %>" /> # ==>
/pictures/show/70
The funny thing is that the image still loads OK in the second case. Can
anyone explain what is going on?
Thanks
Peter
Windows XP
C:\>gem list
C:\>"c:\ruby\bin\ruby.exe" "c:\ruby\bin\gem" list
*** LOCAL GEMS ***
actionmailer (0.7.0, 0.6.1)
Service layer for easy email delivery and testing.
actionpack (1.5.0, 1.4.0)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.5.0)
Web service support for Action Pack.
activerecord (1.7.0, 1.6.0)
Implements the ActiveRecord pattern for ORM.
activesupport (1.0.0)
Support and utility classes used by the Rails framework.
rails (0.10.0, 0.9.5)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.4.15)
Ruby based make-like utility.
RMagick-win32 (1.7.0)
RMagick is an interface between the Ruby programming language and
the ImageMagick and GraphicsMagick image processing libraries.
rubygems-update (0.8.8)
RubyGems Update GEM
sources (0.0.1)
This package provides download sources for remote gem installation
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails