I want to fetch the Attachment Model's attribute name(pdf_file.file_name) based on condition (if..else). But I am not familiar with Arbe Syntex and cant show the outputs in view.
I am rendering a partial file from my active_admin
class.
The code in my _test.arb
file
f.has_many :course_pdf_attachments, allow_destroy: true do |attachment|
if attachment.object.pdf_file.present?
'Uploaded PDF:'
link_to attachment.object.pdf_file.filename.upcase,
attachment.object.pdf_file_url
end
attachment.input :pdf_file, as: :file
end
The output I am getting in the view is only the input_filed
not the value that I'm trying to show in the conditions.
How to write this code so that my values are visible in the view?
Thanks in Advance
I got bitten by this in the past as well.
link_to
is a rails views helper, using this insidearbres
output capturing doesn't work well, unless you enclose it in a span like so:Another way, this is more arbre-like, is to spell out the
a
tag and say:Let me know if it works.