<% if uploaded_file.image? %>
<%= link_to image_tag(uploaded_file.public_filename(:thumb)), uploaded_file.view_url %>
<% else %> <%= render :partial => 'article', :object => uploaded_file %> <% end %>