字符串包含不匹配

时间:2017-03-16 02:52:14

标签: ruby

我遇到的问题是.pdf的字符串链接与include不匹配?在红宝石。示例代码

http://somelink.com/somepdf.pdf
false

运行程序时的输出。

//var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);

1 个答案:

答案 0 :(得分:4)

尝试先转换为字符串

File.extname(link.to_s) == ".pdf"

OR

{% load staticfiles %} <!-- This should go at the top for readability -->

<!-- Load any site wide JS here -->
<script type="text/javascript" src="{% static 'main.js' %}"></script>

{% block js %}<!-- Put JS in here for extended templates -->{% endblock %}