Files
nairobi/app/helpers/map_locations_helper.rb
Javi Martín b9518d64e1 Use Rails methods to get map location input IDs
We were manually generating the IDs in order to pass them as data
attributes in the HTML in a component where we don't have access to the
form which has the inputs.

However, these data attributes only make sense when there's a form
present, so we can pass the form as a parameter and use it to get the
IDs.

We can now define a map as editable when there's an associated form,
which makes sense IMHO.
2023-05-04 15:27:15 +02:00

10 lines
211 B
Ruby

module MapLocationsHelper
def map_location_available?(map_location)
map_location.present? && map_location.available?
end
def render_map(...)
render Shared::MapLocationComponent.new(...)
end
end