On Fri, Jan 23, 2015 at 9:52 AM, Colin Nolic <lists@ruby-forum.com> wrote:
> 1 - The user search a movie by the name
> 2 - I render a list of movies with various informations (like director,
> actors) fetched from the external API. And yes I need the list to be
> fresh every time.
> 3 - The user pick a movie from the list
> 4 - I store the informations, of the movie the user choose, in the
> database so the user can consult these informations latter.
>
> I'm stuck on how to achieve the step 4.
>
> - I could make another request to the API for the selected movie but I
> want to minimize API's requests.
> - I could extract movie details from the view. I don't know if it's
> truly possible but I doesn't seem quite right anyway.
> - I could store the movie details from the step 2 and delete all
> informations I don't need latter.
> - I could use volatile memory to store movie details from step 2, and
> then store the movie the user choose in the database.
You're writing all this data to a view anyway; why not just make each
entry a form with that movie's data? Choose, click button, submitted
and done. No additional API call, no need for temporary "storage".
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
--
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/CACmC4yAyJV7Ysqx2MM%3DarYCetQBXZjRwQ0wwZXq%2Bef4oZf045w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment