我正在使用 Linkedin gem 来提取 RoR 3 的个人资料信息。
- 宝石:https ://github.com/pengwynn/linkedin
- API 文档:https ://developer.linkedin.com/documents/profile-fields#positions
除非我到达名称中带有破折号的属性,否则一切正常。
<%=position.title %>
正确显示但<%= position.start-date %>
返回NoMethodError
in Users#show
- undefined method start
。
我尝试了不同的操作,例如“startDate”、“start_date”、“start-date”周围的引号,但都没有奏效。
是否有适当的方法来转义属性名称中的破折号/连字符?