Rails5.1.3でWebアプリケーション制作の勉強中です。簡単なエラーだと思うのですが、何が原因かわからないのでどなたか
教えていただけないでしょうか? エラー と コードの内容は以下になります。
SyntaxError (/home/vagrant/chibi/chibi/app/controllers/customer/scores_controlle r.rb:117: syntax error, unexpected tIDENTIFIER, expecting keyword_end /home/vagrant/chibi/chibi/app/controllers/customer/scores_controller.rb:119: syn tax error, unexpected tIDENTIFIER, expecting keyword_end /home/vagrant/chibi/chibi/app/controllers/customer/scores_controller.rb:152: syn tax error, unexpected tIDENTIFIER, expecting keyword_then or ';' or '\n' /home/vagrant/chibi/chibi/app/controllers/customer/scores_controller.rb:162: syn tax error, unexpected keyword_end, expecting end-of-input):
class Customer::ScoresController < Customer::Base def show score = Score.find_by(customer_id: current_customer.id) data = score.attributes time = Time.now @month = time.month @mpt = data["sc_#{@month}"] @customer = Customer.find_by(id: current_customer.id) eagle = @customer.nickname @ccc = Sponsor.where(sponsor1:eagle).pluck(:customer_id) @ddd = @ccc.length eee = [] @ccc.each do |r| @coala = Register.find_by(customer_id: r) register_check if fox == "在籍" eee << r end @fff = eee.length if @ddd == @fff else jjj = @ccc - eee if month == 1 fox = @coala.jan elsif @month == 2 fox = @coala.feb elsif @month == 3 fox = @coala.mar elsif @month == 4 fox = @coala.apr elsif @month == 5 fox = @coala.may elsif @month == 6 fox = @coala.jun elsif @month == 7 fox = @coala.jul elsif @month == 8 fox = @coala.aug elsif @month == 9 fox = @coala.sep elsif @month == 10 fox = @coala.oct elsif @month == 11 fox = @coala.nov else fox = @coala.dec end jjj.each do |t| hhh = Customer.find(t) iii = hhh.nickname aaa = Sponsor.where(sponsor1: iii).pluck(:customer_id) kkk = [] vvv = [] aaa.each do |u| @coala = Ragister.find_by(customer_id: u) register_check if fox == "在籍" kkk << u end if fox == "不在" vvv << u end end end end if kkk != "nil" eee << r else register_check end if kkk != "nil" eee << r else register_check end if kkk != "nil" eee << u else register_check end if kkk != "nil" eee << u else register_check end if kkk != "nil" eee << u else register_check end if kkk != "nil" eee << u end end @lily = eee.length end def register_check vvv.each do |t| hhh = Customer.find(t) #117行目 iii = hhh.nickname aaa = Sponsor.where(sponsor1: iii).pluck(:customer_id) # 119行目 kkk = [] vvv = [] aaa.each do |u| @coala = Ragister.find_by(customer_id: u) if month == 1 fox = @coala.jan elsif @month == 2 fox = @coala.feb elsif @month == 3 fox = @coala.mar elsif @month == 4 fox = @coala.apr elsif @month == 5 fox = @coala.may elsif @month == 6 fox = @coala.jun elsif @month == 7 fox = @coala.jul elsif @month == 8 fox = @coala.aug elsif @month == 9 fox = @coala.sep elsif @month == 10 fox = @coala.oct elsif @month == 11 fox = @coala.nov else fox = @coala.dec end if fox == "在籍" #152行目 kkk << u end if fox == "不在" vvv << u end end end end end # 162行目
初心者のためコードがごちゃごちゃしていますがエラーの解決方法を教えていただけないでしょうか?
それとregister_checkメソッドの読み込みは、単純にコードの中にregister_checkと記述しただけで読み込んでくれるのでしょうか?
宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。