Home>

Currently, I am creating a customer management application with rails.
I want to hide only the id 1 page, but it doesn't work

Thanks for your cooperation.

Corresponding source code

searches/index.html.erb

<table><thead class = "category"><tr>  <th>name</th>  <th>Frikana</th>  <th>Gender</th>  <th>age</th>  <th>Company name</th>  <th>Job title</th>  <th>Zip code</th>  <th>Address</th>  <th>phone number</th>  <th colspan = "9"></th></tr></header><tbody><% @ searches.each do | search |%><tr><th class = addless><% = search.family_name%>    <% = search.first_name%>&emsp;</th><th class = addless><% = search.family_name_kana%>    <% = search.first_name_kana%>&emsp;</th><th class = addless><% = search.sex%>&emsp;</th><th class = addless><% = search.age%>&emsp;</th><th class = addless><% = search.company%>&emsp;</th><th class = addless><% = search.position%></th><% search.postal_code.to_s.insert (3, "-")%><th class = addless><% = search.postal_code%>&emsp;</th><th class = addless><% = search.address1%><% = search.address2%><% = search.address3%><% = search.building_name%>&emsp;</th><th class = addless><% = search.phone_number%></th><th><% = link_to'Details', search, class: "button is-info"%></th><th><% = link_to'edit', edit_search_path (search.id), class: "button is-success"%></th><th><% = link_to'Delete', search_path (search.id), method:: delete, class: "button is-danger", data: {confirm:'Are you sure I want to delete?'}%></th></tr><% end%></tbody></table>


searches_controller.rb

class SearchesController</pre>
<p><br />
routes.rb</p>
<pre><code data-language = "Ruby">Rails.application.routes.draw do
  get'searches', to: "searches # index"
  mount RailsAdmin :: Engine =>'/ admin', as:'rails_admin'
  devise_for: users, controllers: {
   omniauth_callbacks:'users/omniauth_callbacks',
   registrations:'users/registrations'
  }
  post'/ callback'=>' linebot # callback'
  get'homes/index'
  resources: homes, only: [: index]
  root to:'home # index'
  resources: users
  resources: attendances
  resources: daytimes
  resources: restaurants, only: [: index,: show]
  resources: searches do
    collection do
      get'search'
    end
  end
  namespace: admin do
    resources: restaurants, only: [: index,: new,: create,: show,: edit,: destroy]
  end
end
What I tried

I wrote<% unless @searches_id == 1%>after<% @ searches.each do | search |%>in index.html.erb, but I can't retrieve the id well and no error occurs.
<% unless searches_id == 1%>NameError
undefined local variable or method `searches_id'for #<#: 0x00007fedd2e4e6d0>
Did you mean? searches_url
@searches
It is written as.

Supplementary information (FW/tool version, etc.)

ruby '2.6.5'