Ruby on Rails
Thursday, August 22, 2013
Tamouse,
-- I really appreciate this, and apologize for the partial code...
`wine` is the parameter of a render function:
function renderDetails(wine) { $('#wineId').val(wine.id); $('#name').val(wine.name); $('#grapes').val(wine.grapes); $('#country').val(wine.country); $('#region').val(wine.region); $('#year').val(wine.year); $('#pic').attr('src', wine.picture); $('#description').val(wine.description); }
During runtime, the variable is filled with this JSON:
- wine: Object
- country: "France"
- description: "The aromas of fruit and......"
- grapes: "Grenache / Syrah"
- id: 1
- name: "CHATEAU DE SAINT COSME"
- picture: "saint_cosme.jpg"
- region: "Southern Rhone / Gigondas"
- year: "2009"
- PS I am new to Rails, so please forgive the noob :)
Thanks in Advance,
Nick.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ca591adb-12da-433c-a2de-884b42de529c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment