Skip to content

Instantly share code, notes, and snippets.

@horitaku1124
Last active August 29, 2015 14:06
Show Gist options
  • Save horitaku1124/5a2ee4d1db37af454df0 to your computer and use it in GitHub Desktop.
Save horitaku1124/5a2ee4d1db37af454df0 to your computer and use it in GitHub Desktop.
Ruby on Railsの覚え書き
  • 2000年1月1日のフォーマット
<%==
   sprintf(
   f.date_select(
     :open_day ,
     :use_month_numbers => true,
     :date_separator => '%s'
 ), '年', '月'); %>
  • MySQLのクエリ
sql = ActiveRecord::Base.send(:sanitize_sql_array, ["insert into foo (bar, baz) values (?, ?), (?, ?)", 'a', 'b', 'c', 'd'])
res = ActiveRecord::Base.connection.execute(sql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment