From 42b81b5a5fccc05241629f3365a5a7ed9d1b8d81 Mon Sep 17 00:00:00 2001 From: Guillaume Dott Date: Thu, 12 Nov 2015 12:40:16 +0100 Subject: [PATCH] Add action to get movie infos --- lib/librarix/application.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librarix/application.rb b/lib/librarix/application.rb index af680a4..db93d3c 100644 --- a/lib/librarix/application.rb +++ b/lib/librarix/application.rb @@ -28,6 +28,11 @@ module Librarix slim :index, locals: {movies: Librarix::Filter.new(params).movies} end + get '/movie/:id' do |id| + movie = Librarix::Redis::Movie.new(id).fetch + slim :movie, layout: !request.xhr?, locals: {movie: movie} + end + get '/search' do movies = if params['search'].nil? Tmdb::Movie.popular.map { |m| Tmdb::Movie.new(m) }