Sha256: c4593f1a0f690bc2a6ae7e1f24bb8fc5894fbb77053dc1e9717d5e4b50ec28d2

Contents?: true

Size: 411 Bytes

Versions: 1

Compression:

Stored size: 411 Bytes

Contents

module UsersHelper
  def user_link(user, with_edit=false)
    user_link_if(true, user, with_edit)
  end

  def user_link_if(condition, user, with_edit=false)
    result = link_to_if(condition, h(user.dn), :action => "show", :id => user)
    if with_edit and current_user and current_user.ldap_user == user
      result << "\n(#{link_to(_('Edit'), :action => 'edit', :id => user)})"
    end
    result
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-activeldap-0.8.3.1 examples/al-admin/app/helpers/users_helper.rb