<th><%= Programme.human_attribute_name("sample_file_path") rescue "Uploaded Sample File" %></th>
<td>
<%= link_to @programme.file_path, class: "list-group-item", target: :_blank do %>
<i class='icon-file'></i>
<%= @programme.sample_file_path.file.filename rescue "No File Uploaded" %>
<% end %>
</td>
this is my view part code where i need to change, here i need if condition because in the above code irrespective of file uploaded or not it is acting as a link without file also. "No File Uploaded" this is also acting as link now