Link to has many
# general
t
@loud-jewelry-99127 @lemon-wall-20836 can you guys help me with a simple question? I have a has_many relation, but I don't want to render the records in the page I want a link to see the records in another page, so I implemented the code below
Copy code
field(:suppliers, as: :text, only_on: :show) do
  encoded_filters = Base64.encode64({"Avo::Filters::BuyerFilter" => record.id}.to_json)
  link_to("SUPPLIERS", resources_suppliers_path(encoded_filters:))
end
It worked pretty well, but would be nice if there is a easier way to do that
l
IMO it's looking good
and it's customizable
you could take it a bit further using custom field components
l
And if it's something that you need across several resources you could implement a custom field https://docs.avohq.io/3.0/custom-fields.html#custom-fields