Last active
August 29, 2015 14:14
-
-
Save soilforlifeforms/d25b24904b6050912eed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Started GET "/gardener_questionnaires/16/answers/new" for 127.0.0.1 at 2015-02-02 11:46:56 +0200 | |
| Started GET "/gardener_questionnaires/16/answers/new" for 127.0.0.1 at 2015-02-02 11:46:56 +0200 | |
| Processing by AnswersController#new as HTML | |
| Processing by AnswersController#new as HTML | |
| Parameters: {"gardener_questionnaire_id"=>"16"} | |
| Parameters: {"gardener_questionnaire_id"=>"16"} | |
| User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 3 ORDER BY "users"."id" ASC LIMIT 1 | |
| User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = 3 ORDER BY "users"."id" ASC LIMIT 1 | |
| GardenerQuestionnaire Load (0.3ms) SELECT "gardener_questionnaires".* FROM "gardener_questionnaires" WHERE "gardener_questionnaires"."id" = $1 LIMIT 1 [["id", 16]] | |
| GardenerQuestionnaire Load (0.3ms) SELECT "gardener_questionnaires".* FROM "gardener_questionnaires" WHERE "gardener_questionnaires"."id" = $1 LIMIT 1 [["id", 16]] | |
| Questionnaire Load (0.2ms) SELECT "questionnaires".* FROM "questionnaires" WHERE "questionnaires"."id" = $1 LIMIT 1 [["id", 1]] | |
| Questionnaire Load (0.2ms) SELECT "questionnaires".* FROM "questionnaires" WHERE "questionnaires"."id" = $1 LIMIT 1 [["id", 1]] | |
| Question Load (1.3ms) SELECT "questions".* FROM "questions" INNER JOIN "questionnaires_questions" ON "questions"."id" = "questionnaires_questions"."question_id" WHERE "questionnaires_questions"."questionnaire_id" = $1 [["questionnaire_id", 1]] | |
| Question Load (1.3ms) SELECT "questions".* FROM "questions" INNER JOIN "questionnaires_questions" ON "questions"."id" = "questionnaires_questions"."question_id" WHERE "questionnaires_questions"."questionnaire_id" = $1 [["questionnaire_id", 1]] | |
| Rendered answers/new.html.erb within layouts/application (12.0ms) | |
| Rendered answers/new.html.erb within layouts/application (12.0ms) | |
| Completed 500 Internal Server Error in 26ms | |
| Completed 500 Internal Server Error in 26ms | |
| ActionView::Template::Error (undefined method `What is the length of your garden?' for #<Answer:0x007f9af79b1128>): | |
| 3: | |
| 4: <% @questionnaire.questions.each do |field| %> | |
| 5: <%= f.label field.question %> | |
| 6: <%= f.text_field field.question %> | |
| 7: <% end %> | |
| 8: <%= f.submit %> | |
| 9: <% end %> | |
| app/views/answers/new.html.erb:6:in `block (2 levels) in _app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| app/views/answers/new.html.erb:4:in `block in _app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| app/views/answers/new.html.erb:1:in `_app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| ActionView::Template::Error (undefined method `What is the length of your garden?' for #<Answer:0x007f9af79b1128>): | |
| 3: | |
| 4: <% @questionnaire.questions.each do |field| %> | |
| 5: <%= f.label field.question %> | |
| 6: <%= f.text_field field.question %> | |
| 7: <% end %> | |
| 8: <%= f.submit %> | |
| 9: <% end %> | |
| app/views/answers/new.html.erb:6:in `block (2 levels) in _app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| app/views/answers/new.html.erb:4:in `block in _app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| app/views/answers/new.html.erb:1:in `_app_views_answers_new_html_erb__791067481078297384_70151772577520' | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.3ms) | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.3ms) | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (3.7ms) | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (3.7ms) | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (21.9ms) | |
| Rendered /Users/michaelfuller/.rvm/gems/ruby-2.1.2@rails-devise-pundit/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (21.9ms) |
This file contains hidden or 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 GardenerQuestionnairesController < ApplicationController | |
| before_filter :authenticate_user! | |
| def new | |
| #1st you retrieve the group thanks to params[:group_id] | |
| #2nd you build a new comment | |
| #@question = question.new | |
| @gardener_questionnaire = GardenerQuestionnaire.new | |
| @gardener= current_user.gardeners | |
| @group = current_user.groups | |
| @questionnaire = Questionnaire.all | |
| # @gardener_questionnaire= @gardener.build_gardener_questionnaire | |
| end | |
| def create | |
| @gardener_questionnaire = GardenerQuestionnaire.new(gardener_questionnaire_params) | |
| # @gardener_questionnaire.new(gardener_questionnaire_params) | |
| if @gardener_questionnaire.save | |
| redirect_to new_gardener_questionnaire_answer_path (@gardener_questionnaire) | |
| end | |
| end | |
| private | |
| def gardener_questionnaire_params | |
| params.require(:gardener_questionnaire).permit(:gardener_id, :questionnaire_id, gardener_attributes: [:id], questionnaire_attribues: [:id]) | |
| end | |
| end |
This file contains hidden or 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 [@gardener_questionnaire, @answer] do |f| %> | |
| <div class ="field"> | |
| <% @questionnaire.questions.each do |field| %> | |
| <%= f.label field.question %> | |
| <%= f.text_field field.question %> | |
| <% end %> | |
| <%= f.submit %> | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment