it with something else RAILS を他のものと混ぜ合わせるのではなく、拡張しよう Growing the Rails Way is possible if you don't fight the framework フレームワークと戦わなければ Rails Way で成⻑することは可能です Vladimir Dementyev (2024) Rails Way, or the highway Kaigi on Rails 2024
select * from users where id = 284 and exists (select * from posts where users.id = posts.user_id); QUERY PLAN ---------------------------------------------------------------------------------------- Nested Loop Semi Join (cost=4.36..22.94 rows=1 width=1798) -> Index Scan using users_pkey on users (cost=0.14..8.16 rows=1 width=1798) Index Cond: (id = 284) -> Bitmap Heap Scan on posts (cost=4.22..14.76 rows=9 width=8) Recheck Cond: (user_id = 284) -> Bitmap Index Scan on posts_user_id_index (cost=0.00..4.22 rows=9 width=0) Index Cond: (user_id = 284) EXPLAINによるSQL実⾏計画の表⽰
function registerViewFinder() { $this->app->bind('view.finder', function ($app) { return new FileViewFinder($app['files'], $app['config']['view.paths']); }); } view.finderサービス: テンプレートファイルを探す処理
register() $this->app->bind('view.finder', function ($app) { // return new FileViewFinder($app['files'], $app['config']['view.paths']); return new ExtendedFileViewFinder( new MobileDetect(), $app['files'], $app['config']['view.paths'], ); });
{ // 完全なレスポンス return new Response( '君の電話番号は何番かね?', Response::HTTP_OK ); } public function answer(): int { // スカラー値 return 5761455; } public function me(): View { // ビュー return view('root', [ 'age' => 10, ]); } public function index(): Model { // Eloquentコレクション return PrimeNumber::all(); }