Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

単語帳機能のajax部分の実装 #8

Merged
merged 14 commits into from Jan 11, 2019
Merged

単語帳機能のajax部分の実装 #8

merged 14 commits into from Jan 11, 2019

Conversation

yoshi3315
Copy link
Owner

やりたかったこと

  • 単語帳機能のうち、ajax部分を実装

やったこと

  • respond_toメソッドでajaxのリクエストに対する処理を記載
  • jsで表示を切り替えるために、divタグにクラス名を追加、パーシャルテンプレートの作成、jsファイルの作成
  • スコアリングの処理を記載
  • デフォルトで最初の選択肢を選択状態にする

動作確認方法

https://word-test-app.herokuapp.com/

  • ID:test, pass:testtestでログイン
  • 単語帳リンクから単語帳ページで最初の選択肢が表示されていることを確認
  • 50問回答するとルートページに遷移することを確認

その他

session[:number_of_questions] += 1
else
session[:already_used_questions] = []
session[:number_of_questions] = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一問目なのにsession[:number_of_questions] = 0はゼロなのか

<%= form_with url: tango_tests_path do |f| %>
<% @choices.each.with_index(1) do |choice, index| %>
<div class="form-check">
<% if index == 1%>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最後に半角スペースがない

@kawa-mon kawa-mon merged commit 7f714f1 into master Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants