2014-02-12 67 views

回答

1

從色器件文檔,

config.http_authenticatable_on_xhr =真

If http headers should be returned for AJAX requests. True by default. 

config.navigational_formats = [" / ",:HTML,:JSON]

==> Navigation configuration 
    Lists the formats that should be treated as navigational. Formats like 
    :html, should redirect to the sign in page when the user does not have 
    access, but formats like :xml or :json, should return 401. 

    If you have any extra navigational formats, like :iphone or :mobile, you 
    should add them to the navigational formats lists. 

    The :"*/*" and "*/*" formats below is required to match Internet 
    Explorer requests.