OOZOU
お問い合わせ
Back to TILToday I Learned

ruby on rails

22 notes on ruby on rails from the OOZOU team.

all topicsshell 30ruby on rails 22ruby 12macos 10vim 7figma 4cli 3javascript 3heroku 1elixir 1
ruby on rails2022年2月10日

Use Pundit Policies to manage permitted parameters, defaults and per action

To manage permitted params you can add permitted\attributes and permitted\attributes\for\#{action} in your policies e.g.

ruby on rails2022年1月31日

Use `requestSubmit` for form submits with Turbo

Turbo listens to submit events on form.  Hence, always use requestSubmit to submit  a form using JS.

ruby on rails2022年1月19日

Ignore bundled gems for Rubocop and ESLint in GitHub Actions

Rails projects will often install gems into the vendor directory in GitHub actions so we can cache them for the consecutive runs.

ruby on rails2021年4月18日

Rails 6, Ruby 3, Bootstrap 5 and Hotwire

Extending the blogpost from Bootrails with Hotwire: All the fancy new things (as of when I'm writing this TIL):

ruby on rails2020年10月27日

Rails Cache-Control

For enabling setting cache-control headers of static assets and using a CDN on Heroku:

ruby on rails2020年10月14日

Fix input on Heroku's rails console

If you end up pasting lots of lines into a rails console on Heroku (or else where), you might get issues with the lines "bleeding" into each other.

ruby on rails2020年10月14日

Unique ID for DOM in Rails

Rails has many great view helpers, one of which is dom\id:*

ruby on rails2020年10月13日

Add new types to Rails 5 attributes API

The Rails 5 attributes API allows us to build form objects very easily.

ruby on rails2020年10月13日

Attaching file to ActiveStorage without HTTP

If you want to attach a file you generated on disk or downloaded from a user-submitted URL, you can do it like this.

ruby on rails2020年10月13日

Create a Hash from an Enumerable (Rails 6.0)

New method allowing you to create a Hash from an Enumerable:

ruby on rails2020年10月13日

Create idempotent migrations

When you want to write destructive migrations please use if\exists: true when you’re trying to remove a table and check for a table existence when you want to add or remove a column…

ruby on rails2020年10月13日

How to find god objects in your project (Rails)

Go to your project root and cd into app/models (using CLI obviously) then run wc -lw \ | sort -u*

ruby on rails2020年10月13日

HTML forms that submit to another action

I've known for a long time that you can submit values with submit buttons so you can track which button was used to submit the form e.g.

ruby on rails2020年10月13日

If you want to override previously set order

If you want to override previously set order (even through default\_scope), use reorder() instead.

ruby on rails2020年10月13日

Limited has_many associations

Limited has_many associations

ruby on rails2020年10月13日

List your model names

NOTE: RUBYOPT=-W0 avoids verbosity when running rails command which suppresses warnnings.

ruby on rails2020年10月13日

Postgres Functions & Non-sargable Queries

Using postgres functions inside a where clause can make a query non-sargable.

ruby on rails2020年10月13日

PostgreSQL UPDATE Join

This query shows how to use the PostgreSQL UPDATE join syntax to update data in a table based on values in another table. for example;

ruby on rails2020年10月13日

Scope or scope in Rails

scope :human, -> { user.or(author) } scope :terminator, -> { admin.or(robot) } `

ruby on rails2020年10月13日

Show TODO and other notes in your Rails app

Did you know you can show all TODOs/OPTIMIZE/FIXME in your rails app with rails notes?

ruby on rails2020年10月13日

Tag rails logs with useful information

Just learned about tagged logging in rails. Did you know you can tag a log by using

ruby on rails2020年10月13日

Use minItems/maxItems in collection JSON schemas

To make your collection JSON schemas more reilable use minItems and maxItems so that you can trust your API.

プロジェクトをお考えですか?

あなたが構築しているものについてお聞かせください。

会話を始めるhello@oozou.com
OOZOU Logo

バンコク · シンガポール · 香港

X
Facebook
Instagram
LinkedIn

サービス

  • ウェブ開発
  • AI・生成AIソリューション
  • モバイルアプリ開発
  • データ分析・エンジニアリング
  • UI/UXデザイン・プロダクトデザイン
  • デジタルトランスフォーメーション

会社情報

  • 会社概要
  • 採用情報
  • ブログ
  • ホワイトペーパー
  • 事例研究
  • Today I Learned
  • お問い合わせ

その他

  • 業界
  • 見積もりを取得
  • パートナーネットワーク
© 2026 OOZOU. All rights reserved.
プライバシーポリシー行動規範ABACポリシー