Skip to content

Instantly share code, notes, and snippets.

View adamjgrant's full-sized avatar

Adam Grant adamjgrant

  • Software Engineer
View GitHub Profile
server {
listen 19855;
passenger_enabled on;
root /home/vegan/webapps/lab95ror/lab95/public;
server_name localhost;
rails_env production;
}
def show
@survey = Survey.find(params[:id])
@questions = @survey.questions
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @survey }
end
end
##### ERROR
undefined method `question_path' for #<#<Class:0x007fa183901da8>:0x007fa1838e2ca0>
##### VIEW
<% @questions.each do |question| %>
<tr>
<td><a href="/surveys/<%= @survey.id %>/questions/<%= question.id %>/"><%= question.question %></td>
<td><%= question.qtype %></td>
Started POST "/surveys/2/questions/4/responses" for 127.0.0.1 at 2013-06-20 11:22:16 -0400
Processing by ResponsesController#create as */*
Parameters: {"response"=>{"answer"=>"Extremely likely"}, "survey_id"=>"2", "question_id"=>"4"}
Question Load (0.1ms) SELECT "questions".* FROM "questions" WHERE "questions"."id" = ? LIMIT 1 [["id", "4"]]
Survey Load (0.1ms) SELECT "surveys".* FROM "surveys" WHERE "surveys"."id" = ? LIMIT 1 [["id", "2"]]
CACHE (0.0ms) SELECT "questions".* FROM "questions" WHERE "questions"."id" = ? LIMIT 1 [["id", "4"]]
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4 LIMIT 1
(0.0ms) begin transaction
SQL (0.4ms) INSERT INTO "responses" ("answer", "created_at", "question_id", "responderId", "survey_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["answer", "Extremely likely"], ["created_at", Thu, 20 Jun 2013 15:22:16 UTC +00:00], ["question_id", 4], ["responderId", 4], ["survey_id", nil], ["updated_at", Thu, 20 Jun 2013 15:22:16 UTC +00:00]]
2013-06-23T16:52:03.542932+00:00 app[web.1]: Started POST "/users" for 74.66.250.183 at 2013-06-23 16:52:03 +0000
2013-06-23T16:52:03.553612+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"5TrUps3WtG5ipRG3+rfyxkmithaMJs9AtsyTwCDk97c=", "user"=>{"email"=>"ajkochanowicz@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2013-06-23T16:52:03.553612+00:00 app[web.1]: Processing by Devise::RegistrationsController#create as HTML
2013-06-23T16:52:03.732218+00:00 app[web.1]: Rendered devise/mailer/confirmation_instructions.html.erb (1.7ms)
2013-06-23T16:52:03.749237+00:00 app[web.1]: Redirected to http://lab95.herokuapp.com/
2013-06-23T16:52:03.753163+00:00 app[web.1]: Completed 302 Found in 199ms (ActiveRecord: 0.0ms)
2013-06-23T16:52:03.752518+00:00 heroku[router]: at=info method=POST path=/users host=lab95.herokuapp.com fwd="74.66.250.183" dyno=web.1 connect=1ms service=218ms status=302 bytes=93
Started POST "/users" for 127.0.0.1 at 2013-06-23 12:59:53 -0400
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"helxd+bwauZbLszMO/4tYgUFHu/6eSuO1nF4mabxbEw=", "user"=>{"email"=>"ajkochanowicz@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
 (0.1ms) begin transaction
User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'ajkochanowicz@gmail.com' LIMIT 1
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'iixxfxAMzqFNq59L2iNx' LIMIT 1
Binary data inserted for `string` type on column `encrypted_password`
SQL (2.2ms) INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "level", "remember_created_at", "reset_passwor
# Load the rails application
require File.expand_path('../application', __FILE__)
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => "587",
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'lab95.com',
Surveyrunner::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
Surveyrunner::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
Started POST "/users" for 127.0.0.1 at 2013-06-23 15:36:05 -0400
Processing by Devise::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"helxd+bwauZbLszMO/4tYgUFHu/6eSuO1nF4mabxbEw=", "user"=>{"email"=>"d@d.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
 (0.1ms) begin transaction
User Exists (0.5ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'd@d.com' LIMIT 1
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."confirmation_token" = 'c7KbqN83zpVERjkSCasy' LIMIT 1
Binary data inserted for `string` type on column `encrypted_password`
SQL (2.6ms) INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "level", "remember_created_at", "reset_password_sent_at", "reset_password_toke