This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @category.errors.any? %> | |
<div id="error_explanation"> | |
<h2> | |
<%= pluralize(@category.errors.count, "error") %> gør, at ændringen ikke kan gennemføres: | |
</h2> | |
<ul> | |
<% @category.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::UnknownAttributeError in QuizCategoriesController#new | |
unknown attribute 'quiz_category_id' for QuizQuestion. | |
Rails.root: F:/Arbejde/Programmering/Workspace/studmed | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/quiz_categories_controller.rb:16:in `new' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @category.errors.any? %> | |
<div id="error_explanation"> | |
<h2> | |
<%= pluralize(@category.errors.count, "error") %> gør, at ændringen ikke kan gennemføres: | |
</h2> | |
<ul> | |
<% @category.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::ParameterMissing in QuizCategoriesController#create | |
param is missing or the value is empty: quiz_question | |
Rails.root: F:/Arbejde/Programmering/Workspace/studmed | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/quiz_categories_controller.rb:63:in `quiz_question_params' | |
app/controllers/quiz_categories_controller.rb:21:in `create' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @question do |f| %> | |
<p> | |
<%= f.label :question %> <br> | |
<%= f.text_area :question, placeholder:"Spørgsmål?" %> <br> | |
</p> | |
<p> | |
<%= f.label :answer%> <br> | |
<%= f.check_box :answer %> <br> | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuizQuestionsController < ApplicationController | |
def index | |
@questions = QuizQuestion.all | |
end | |
def show | |
@question = QuizQuestion.find(params[:id]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to 'Tilbage', questions_path %> | |
<%= form_for @question do |f| %> | |
<% if @question.errors.any? %> | |
<div id="error_explanation"> | |
<h2> | |
<%= pluralize(@question.errors.count, "error") %> gør, at ændringen ikke kan gennemføres: | |
</h2> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
if question.correct == true | |
puts 'true' | |
else | |
puts 'false' | |
end | |
%> |