How to write a channel.html file in Rails (for Facebook)

前端 未结 4 2057
醉梦人生
醉梦人生 2021-02-08 22:57

According to the FB SDK I must include a channel file with the appropriate headers.

Being a major NOOB and a Rails not PHP developer I have no idea how to do this.

4条回答
  •  深忆病人
    2021-02-08 23:36

    Use the response.headers hash in your controller. Docs

    Example from your example

    cache_expire = 60*60*24*365
    response.headers["Pragma"] = "public"
    response.headers["Cache-Control"] = "max-age=#{cache_expire}"
    response.headers["Expires"] = ... # I'll leave this one to you.
                                      # (Or ask another Q.) 
                   # gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
    

提交回复
热议问题