unicode 與 UTF-8
記錄一下,不錯的文章 講解了編碼的原理,與用 ruby 如何轉換編碼 A Rubyist’s Introduction to Character Encoding, Unicode and UTF-8 »
記錄一下,不錯的文章 講解了編碼的原理,與用 ruby 如何轉換編碼 A Rubyist’s Introduction to Character Encoding, Unicode and UTF-8 »
看到一篇不錯的文章,詳細的介紹了 ssr、csr 的不同與優缺點,還附上了 demo 與 example code Server-Side Rendering with React, Redux, and React-Router 各別優缺點 CSR (Client-Side Rendering) PROS Rich site interactions Fast rendering after the initial load Partial real-time updates »
在寫 rails query 時, 常常會寫出這樣的句子 User.joins([posts: :likes]).where('posts.created_at': 30.days.ago..Time.current).order("posts.id DESC") 如果條件越來越複雜, query 會寫得越來越長 這時候可以使用 ActiveRecord::SpawnMethods的 merge 來整理 query 假設我們有三個 tables class User < ApplicationRecord »
在 import 完 .sql 檔到專案的 postgres 後 使用 rails console 操作 db, 出現了以下錯誤訊息: ActiveRecord::StatementInvalid (PG::InsufficientPrivilege: ERROR: permission denied for schema public) LINE 1: SELECT 1 FROM ONLY "public"."users" x WHERE "id" OPERATOR(pg... »
繼上一篇, 使用 rails 轉 pdt 就簡單多了 使用 api intimezone .in_time_zone('Pacific Time (US & Canada)') »
最近碰到一個需求, 需要把 rails form 的 input (datetime) 用 js 即時轉換成太平洋時區顯示在畫面上 js 可以使用 method toLocaleString dateObj.toLocaleString([locales[, options]]) 前面的 locales 參數影響顯示的格式, 後面的 options 用到的是 timeZone。需要填入 Asia/Taipeu、America/New_York 這種格式 example code # 取得 »