app/controllers/lookbook/app_controller.rb in lookbook-0.4.0.beta.1 vs app/controllers/lookbook/app_controller.rb in lookbook-0.4.0.beta.2
- old
+ new
@@ -48,10 +48,10 @@
end
def find_preview
candidates = []
params[:path].to_s.scan(%r{/|$}) { candidates << $` }
- match = candidates.detect { |candidate| Lookbook::Preview.exists?(candidate) }
+ match = candidates.reverse.detect { |candidate| Lookbook::Preview.exists?(candidate) }
@preview = match ? Lookbook::Preview.find(match) : nil
end
def find_example
@example = if @preview