<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kanahebiZ</author_name>
  <author_url>https://blog.hatena.ne.jp/kanahebiZ/</author_url>
  <blog_title>もふもふ技術部</blog_title>
  <blog_url>https://www.mof-mof.co.jp/tech-blog/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>Formオブジェクト</anon>
    <anon>Finderオブジェクト</anon>
    <anon>検索</anon>
  </categories>
  <description>Railsで検索を実装するとき、どのように実装しますか？ ransack などのGemを使っていますか？ 今回は、Gemを使わずにFinderオブジェクトを使って検索を実装してみます。 Finderオブジェクトを使うと、モデルとコントローラーから検索のロジックを切り離すことができます。 事前準備 1. モデルを作る $ rails g model post 20241117000000_posts.rb class CreatePosts &lt; ActiveRecord::Migration[7.1] def change create_table :posts do |t| t.referen…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.mof-mof.co.jp%2Ftech-blog%2F2024%2F11%2F18%2F172212&quot; title=&quot;【Rails】Gemを使わないFinderオブジェクトを使った検索 - もふもふ技術部&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-11-18 17:22:12</published>
  <title>【Rails】Gemを使わないFinderオブジェクトを使った検索</title>
  <type>rich</type>
  <url>https://www.mof-mof.co.jp/tech-blog/2024/11/18/172212</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
