ルーティングいじるのも面倒なので、about#showやabout#moreに突っ込む

about#more haml

:css
.title {
color: gray;
}
a:link { color: #ffffff; }
a:visited { color: #ffffff; }
a:hover { color: #ffffff; }
a:active { color: #ffffff; }

.wrapper.thicc
= link_to( "Topへ", "/")
= link_to( "検索へ", "/about")
%p

- if @output.present?
- @output.each do |v|
= link_to controller: "about", action: "more", id: v.id do
%li= l v.created_at.in_time_zone('Tokyo'), format: :short
%li= v.text
= link_to "/web/statuses/#{v.id}" do
Original Link
%p


about/showのhaml


:css
.title {
color: gray;
}
a:link { color: #ffffff; }
a:visited { color: #ffffff; }
a:hover { color: #ffffff; }
a:active { color: #ffffff; }


.wrapper
= link_to( "Topへ", "/")
%p
= form_tag("/about", method: "get" ) do
= text_field_tag :q, @q , autofocus: true
= submit_tag("過去ログ検索")
%p

- if @output.present?
- @output.each do |v|
= link_to controller: "about", action: "more", id: v.id do
%li= l v.created_at.in_time_zone('Tokyo'), format: :short
= v.text
%p


home#index haml

= form_tag("/about", method: "get" ) do
= text_field_tag :q, @q , autofocus: true
= submit_tag("過去ログ検索")



こんとろーら

def show
@q = params[:q].present? ? params[:q] : nil
@output = @q.present? ? Status.where("text ilike ? and uri is null", "%" + @q + "%") : nil
end

def more
s = params[:id].present? ? Status.where("id = ?", params[:id] )[0] : nil
@output = s.present? ? Status.where("uri is null and created_at between ? and ?", s.created_at - 1.days, s.created_at ) : nil
end




クエリを確認するには
/home/mastodon/live で
bundle exec rails console -e production

反映は
touch tmp/restart.txt


# 検索機能をちゃんとやろうとおもったけどあまりの面倒くささに断念