Topic: Conditional link to not acting correctly if nil
So here is what I have currently (minus classes, etc. for brevity)
content_tag(:nav, :class => "show_image_nav btn-group") do link_to_unless(asset.prev.nil?, "", user_asset_path(asset.prev), :title => "Previous") + link_to_unless(asset.next.nil?, "", user_asset_path(asset.next), :title => "Next") end
This is working as expected IF asset.prev isn't nil OR asset.next isn't nil. I'm at a loss what to do in this situation. My first setup was link_to's inside regular if statements
if asset.prev.nil? link_to(bleh) end + if asset.next.nil? link_to(bleh) end
Same problems. How do you conditionally concatenate in a helper method?