Ok, thanks for the feedback! I will definitely watch out for this in the
future. For some reason, I thought it was simpler to set them as variables
so that the "accessing" of the hash happened in the models, instead of in
erb in the view. But you're telling me that they are the effectively the
same, time-wise?




On Thu, Apr 24, 2014 at 10:21 AM, Spencer Eldred
<notifications@github.com>wrote:

> In movies.rb:
>
> > +
> > +get '/poster/:imdbID' do
> > +	search = params[:imbdID]
> > +	results = Typhoeus.get("http://www.omdbapi.com/?i=#{params[:imdbID]}")
> > +  @omdb_data = JSON.parse(results.body)
> > +
> > +  @poster = @omdb_data["Poster"]
> > +	@plot = @omdb_data["Plot"]
> > +	@released = @omdb_data["Released Year"]
> > +	@rated = @omdb_data["Rated"]
> > +	@runtime = @omdb_data["Runtime"]
> > +	@genre = @omdb_data["Genre"]
> > +	@director = @omdb_data["Director"]
> > +	@actors = @omdb_data["Actors"]
> > +	@link = "http://www.imdb.com/title/#{params["imdbID"]}"
> > +  erb :show
> >  end
>
> I reviewed your app and everything looks good. The only thing that I would
> mention is the creation and use of all these instance variables that need
> to get passed to the views. You could just pass the one @omdb_data object
> to the show.erb view page and dereference the specific items there. In
> show.erb you could write
>  * Plot: * <%=@omdb_data["Plot"] %> . As you have seen in Rails, we pass
> the "@todos" collection of todo items or "@todo" the one item to the view
> and then pluck out the details of the object in the views.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/wdi-sf-march-2014/Sinatra-Movie-App-Part-Deux-Mini-Project/pull/17/files#r11959991>
> .
>



-- 
~~~~~~~~~~~~~~~~~~
Ms. Taylor Parker Chiu
tchiu@post.harvard.edu
650-245-3340