Is there a way to write a clean if nil then in a view. Assuming my lack of ruby is biting me here. Example,
If object nil, then return, nothing found
have
<%= @objects.count if @objects %>
want something like this
<%= @objects.count if @objects then "nothing found" %>
There are many ways to write something like this.
Something simple would be:
If you get into a slightly more complex conditional I would suggest moving the logic into a helper and call it from the view. ex: