ManageIQ/manageiq-ui-classic

View on GitHub
app/helpers/application_helper/button/read_only.rb

Summary

Maintainability
A
0 mins
Test Coverage
D
60%
class ApplicationHelper::Button::ReadOnly < ApplicationHelper::Button::Basic
  needs :@record

  def disabled?
    @error_message = _("This %{klass} is read only and cannot be modified") % {
      :klass => ui_lookup(:model => @record.class.name)
    } if @record.read_only
    @error_message.present?
  end
end