Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Need explanation -> Passing 'id' in a form / link_to
Jean Nibee
6/8/2007 4:10:00 AM
Just need some more inside information...
Sample Code from the AWDWR book.
<%= link_to ( image_tag( product.image_url ),
{ :action => :add_to_cart, :id => product },
:method => :post,
:confirm => "Are you sure?" ) %>
Why is my :id => symbol using 'product' and not 'product.id'
Is the :id symbol 'dual purpose' and used as a key for an id param AND
it also infers that the FIELD to 'get' from the product object is named
'id'?
Thanks.
--
Posted via
http://www.ruby-...
.
1 Answer
Jean Nibee
6/8/2007 2:18:00 PM
0
Sorry, posted here by mistake... reposting to rails forum.
Thanks.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Need explanation -> Passing 'id' in a form / link_to
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password