I need to generate a url in rails that has the user’s api-key in it (webcal://123@mywebsite.com/calendar.ics where ‘123’ is the authentication token for the user), so that the user can use this link without being logged into the app. How do I generate this url?
calendar_publisher_lists_url(:format => :ics, :only_path => false,:protocol => "web cal")
generates a link like webcal://mywebsite.com/calendar.ics how do I add in the api-key?
You can use the
:userand:passwordoptions to add inline HTTP authentication information.http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-url_for