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
q
start_date
end
As far as i know there is no built in way of casting strings to booleans, but if your strings only consist of 'true' and 'false' you could shorten your method to the following:
'true'
'false'
def to_boolean(str) str == 'true' end