You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
473 B

class SubjectIndexFormComponent < BaseComponent
attr_reader :subject_index, :parent_id, :opts
def initialize(current_user:, subject_index:, opts:)
@subject_index = subject_index
@opts = opts
@parent_id = opts[:parent_id]
end
def parent
return if parent_id.blank?
Cdao::Subject.find(parent_id)
end
def current_library
Cdao::Library.first
end
def render?
subject_index.present? && opts[:form_url].present? && opts[:form_method].present?
end
end