Google Maps Places Autocomplete Setup

1. Get Google Maps API Key

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable the Places API (New) and Maps JavaScript API
  4. Create credentials (API Key)
  5. Restrict the API key to your domains for security

2. Configure API Key in Rails

For Development:

# Add to your .env file or export as environment variable
export GOOGLE_MAPS_API_KEY="your_api_key_here"
# Edit Rails credentials
EDITOR=nano rails credentials:edit

# Add this structure:
google_maps:
  api_key: your_api_key_here

3. API Key Restrictions (Security)

Application Restrictions:

API Restrictions:

4. Test the Integration

  1. Start your Rails server: rails server
  2. Navigate to event edit form
  3. Try typing in location fields
  4. You should see Google Places suggestions

5. Troubleshooting

6. Cost Considerations