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.
22 lines
456 B
22 lines
456 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 all_subjects |
|
Cdao::Subject.all.order(name: :asc) |
|
end |
|
|
|
def current_library |
|
Cdao::Library.first |
|
end |
|
|
|
def render? |
|
subject_index.present? && opts[:form_url].present? && opts[:form_method].present? |
|
end |
|
end |
|
|