code . innovation . exploration


Time, Datetime, Weekday query to find records

Find records between time of the day (not date only time) It’s quite straightforward to find records between two datetime. But it would be little tricky to find records between two time, only time not datetime. We can write it that way: Task.where([“:date_time >= start_time::time AND :date_time <= end_time::time”, { date_time: DateTime.current.strftime(‘%H:%M:%S’) }]) Find records…
Read more

sofenx, ruby, ruby-on-rails

Ruby on Rails application with Reactjs

Let’s create a rails application along with ReactJS and other node modules. Install Node.js and NPM (on MAC) I assume MAC already have Xcode and Homebrew installed. In terminal: brew install node Yes, npm (node package manager) comes with node by default. Alternatively, we can use yarn (my preferance also rails prefer it :p). Ah,…
Read more