Forum: Rails Germany Paramsübergabe an open URI

Posted by Rails Camper (railscamper)
on 2009-03-02 21:05
(Received via mailing list)
Ich versuche gerade eine Url als Parameter an eine bestehende Url
anzuhängen, aber leider bekomme ich immer eine Object ID statt der
eigentlichen Url angehängt.
So klappt das mit Open-Uri natürlich nicht ....

@url = Search.new(params[:url])
      @details = Hpricot(open("http://localhost:3000/details/#{@url}"))

-> details/#<Search:0x3a56268>

Was habe ich denn falsch gemacht?

--

Mario Schröder | http://www.ironschroedi.com/de/
Office: +49 361 2152062
Phone: +49 34464 62301 Cell: +49 163 27 09 807
http://www.xing.com/go/invite/6035007.9c143c
Posted by Nicolai Reuschling (codeblogger)
on 2009-03-02 21:17
(Received via mailing list)
Hallo, Mario!

@url ist ein Objekt der Klasse search.Du willst doch sicher nur dessen 
id:
Also einfach @url.id aufrufen (oder to_param).

Grüße
Nicolai
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.