String “true” and “false” to boolean

前端 未结 13 763
青春惊慌失措
青春惊慌失措 2020-12-08 18:23

I have a Rails application and I\'m using jQuery to query my search view in the background. There are fields q (search term), start_date, end

相关标签:
13条回答
  • 2020-12-08 18:52

    Perhaps str.to_s.downcase == 'true' for completeness. Then nothing can crash even if str is nil or 0.

    0 讨论(0)
提交回复
热议问题