How do I create a location field for my form in rails? I want the user to be able to create a post that has an address, I already have the title and description fields but the location field I am having trouble with. I need to use these parameters (I'm confused where to put these in the form):
params.require(:location).permit(:name, :formatted_address, :city, :state,
:zip, :latitude, :longitude,
:google_location_id)
end
#and these are the fields I already have
<p>
<%= form.label :title %> <br>
<%= form.text_field :title, class: 'form-control' %>
</p>
<p>
<%= form.label :details %> <br>
<%= form.text_area :details, :cols => "10", :rows => "7", class: 'form-control' %>
</p>
since you using bootstrap, you can just use text_field, below is sample if user want to put manually their coordinate
you can create with rails generate migration AddGeocodeToLocation, and the type of field is float
and below is sample of form