Reputation: 43
So currently I have inside the public folder a file called "apple-app-site-association" with the content:
{"applinks":{"apps":[],"details":[{"appID":"{#Rails.configuration.appID}","paths":"*"}]}}
Obviously the {#Rails.configuration.appID} is not being generated dynamically and is being output literally, but I would like it to be reading from the config file, where appID is defined. How can I go about this??
Upvotes: 4
Views: 1702
Reputation: 5363
The most straightforward way would be to just add a route.
get '/apple-app-site-association' => 'pages#apple_app_site_association'
def apple_app_site_association
render :json => {"applinks":{"apps":[],"details":[{"appID": Rails.configuration.appID,"paths":"*"}]}}
end
You may need to do more than that, but that should at least get you moving in the right direction.
Update 2020: Typo in route path fixed
Upvotes: 6