app/helpers/application_helper.rb
# Will output a link to the item if it exists and is owned by the
# current logged-in user. Otherwise will just print a text title
Will output a link to the item if it exists and is owned by the
current logged-in user. Otherwise will just print a text title
Will output a link to the item if it exists and is owned by the current logged - in user . Otherwise will just print a text title
def link_if_present(name, type)
    return name unless session[:user]
    result = find_by_name_and_type name, type.downcase, current_user.id
    result.nil? ? name : link_to(name, result)
  end
def link_if_present ( name , type ) return name unless session [ :user ] result = find_by_name_and_type name , type . downcase , current_user . id result . nil? ? name : link_to ( name , result ) end
Will output a link to the item if it exists and is owned by the
current logged-in user.
Will output a link to the item if it exists and is owned by the current logged - in user .
name
<not_specific>
type
<not_specific>