Hej,
Mam taki nietypowy błąd. Zapisuję dane itp. Po zapisie prawa do pliku quiz.controller.rb są automatyczne zmieniane(600) i muszę je ręcznie przestawić. Spotkał się ktoś z takim czymś.?
[code=ruby] def save
#calculate point
@questions = AppQuizQuestion.where(:quiz_id => AppQuiz.find_by_app_id(params[:app_id].to_s).id)
@point = 0
@questions.each do |point|
if params[:n][point.id] == point.correct
@point = @point + 1
end
end
if AppQuizAnswer.where("quiz_id='"+AppQuiz.find_by_app_id(params[:app_id]).id.to_s+"' and user_id='"+session['user_id_app'].to_s+"' and time != ''").count == 0
@app = AppQuizAnswer.find_by_user_id_and_quiz_id(session['user_id_app'].to_s,params[:quiz_id].to_s)
@app.time = params[:time]
@app.html = params[:n].inspect
@app.point = @point
@app.save
@access = true
end
render :json => @access
end[/code]
taki mam błąd
LoadError (cannot load such file -- /home/rails/app/app/controllers/app/quiz_controller.rb):
activesupport (3.2.9) lib/active_support/dependencies.rb:469:in `load'
activesupport (3.2.9) lib/active_support/dependencies.rb:469:in `block in load_file'
activesupport (3.2.9) lib/active_support/dependencies.rb:639:in `new_constants_in'
activesupport (3.2.9) lib/active_support/dependencies.rb:468:in `load_file'
activesupport (3.2.9) lib/active_support/dependencies.rb:353:in `require_or_load'
activesupport (3.2.9) lib/active_support/dependencies.rb:502:in `load_missing_constant'
activesupport (3.2.9) lib/active_support/dependencies.rb:192:in `block in const_missing'
activesupport (3.2.9) lib/active_support/dependencies.rb:190:in `each'
activesupport (3.2.9) lib/active_support/dependencies.rb:190:in `const_missing'
activesupport (3.2.9) lib/active_support/inflector/methods.rb:230:in `block in constantize'
activesupport (3.2.9) lib/active_support/inflector/methods.rb:229:in `each'
activesupport (3.2.9) lib/active_support/inflector/methods.rb:229:in `constantize'
activesupport (3.2.9) lib/active_support/dependencies.rb:554:in `get'
PS ten kod który dałem jest kodem roboczym …