Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
edit home.html
Browse files Browse the repository at this point in the history
  • Loading branch information
OkuhiraShunri committed Dec 22, 2023
1 parent c37d791 commit acc7ab4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def home
:all
end
@scores = @user.scores.send(order) # ソート結果格納
elsif params[:input_value] == :name || params[:input_value] == :composer || params[:input_value] == :arranger
@search_params = score_search_params
@scores = score_search(@search_params)
elsif !params[:input_value].nil?
@search_params = score_search_params # score_search_paramsは検索ボックスの入力値取得メソッド
@scores = Score.score_search(@search_params)# score_serchによりDBから内容取得
elsif !params[:use_gakki].nil?
@search_params = score_search_gakki_params
@scores = score_search_gakki(@search_params)
@scores = Score.score_search_gakki(@search_params)
else
@scores = @user.scores.all
end
Expand Down
20 changes: 20 additions & 0 deletions app/views/users/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
<body>
<div class="center">
<h1>UsersController#home</h1>

<h1>hello</h1>
<%= form_with model: @score do |form| %>
<div class="flex-field">
<div class="box">
<%= form.label :name, "曲名名検索" %>
<%= form.text_field :name %>
</div>
<div class="box">
<%= form.label :composer, "作曲者検索" %>
<%= form.text_field :composer%>
</div>
<div class="box">
<%= form.label :arranger, "編曲者検索" %>
<%= form.text_field :arranger%>
</div>
</div>
<%= button_to "検索", score_path(form), {class: "search-button"} %>
<% end %>

<input type="checkbox" id="hide">
<label class="hide" for="hide">使用楽器</label>
<div class="hide-and-seek">
Expand Down

0 comments on commit acc7ab4

Please sign in to comment.