Ruby on Rails Friday, January 23, 2015

Right, I don't need to store the list of movies in the database.
Here is the scenario:
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.

I thought the latest option was the more appropriate.

I hope I'm more clear this time.

--
Posted via http://www.ruby-forum.com/.

--
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/2a75826c0f46a01d1e8fefca2a5d45a8%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment