Server response
(defn generate-response [data & [status]]
{:status (or status 200)
:headers {"Content-Type" "application/edn"}
:body (pr-str {:1 "hi"})})
First refresh I get this: | |
Gem::LoadError in UsersController#show | |
bcrypt-ruby is not part of the bundle. Add it to Gemfile. | |
Second refresh I get this: | |
NoMethodError in UsersController#show | |
undefined method `key?' for nil:NilClass |
* actionmailer (3.2.1) | |
* actionpack (3.2.1) | |
* activemodel (3.2.1) | |
* activerecord (3.2.1) | |
* activeresource (3.2.1) | |
* activesupport (3.2.1) | |
* annotate (2.4.1.beta1) | |
* arel (3.0.2) | |
* bcrypt-ruby (3.0.1) | |
* builder (3.0.0) |
routes.db | |
Second::Application.routes.draw do | |
resources :users | |
resources :sessions, only: [:new, :create, :destroy] | |
match '/signup', to: 'users#new' | |
match '/signin', to: 'sessions#new' | |
match '/signout', to: 'sessions#destroy', via: :delete | |
match '/help', to: 'static_pages#help' |
$ rails console | |
Loading development environment (Rails 3.2.1) | |
1.9.3-p0 :001 > User.first.remember_token | |
User Load (0.6ms) SELECT "users".* FROM "users" LIMIT 1 | |
NoMethodError: undefined method `remember_token' for #<User:0x007fec96cf9830> | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/activemodel-3.2.1/lib/active_model/attribute_methods.rb:407:in `method_missing' | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:126:in `method_missing' | |
from (irb):1 | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start' | |
from /Users/Will/.rvm/gems/ruby-1.9.3-p0@rails313/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start' |
Failures: | |
1) UsersController GET 'name:string' returns http success | |
Failure/Error: get 'name:string' | |
AbstractController::ActionNotFound: | |
The action 'name:string' could not be found for UsersController | |
# ./spec/controllers/users_controller_spec.rb:6:in `block (3 levels) in <top (required)>' | |
2) UsersController GET 'email:string' returns http success | |
Failure/Error: get 'email:string' |
def gen_sql | |
relation = Set | |
@recipient ||= "company" | |
@date_window ||= "1year" | |
case @date_window | |
when "1day" |
$('#transaction_recipient').on 'change', -> | |
switch $(this).val() | |
when 'artist' then hide_and_slide('artist') | |
when 'venue' then hide_and_slide('venue') | |
when 'affiliate' then hide_and_slide('affiliate') |
function countdown(seconds) { | |
console.log(seconds); | |
window.setTimeout(function(){ | |
if (seconds !== 0) { | |
countdown(seconds - 1); | |
} | |
}, 1000); | |
} | |
(1..100).each do |x| | |
if x%15 == 0 | |
puts "CracklePop" | |
elsif x%3 == 0 | |
puts "Crackle" | |
elsif x%5 == 0; | |
puts "Pop" | |
else | |
puts x | |
end |
Server response
(defn generate-response [data & [status]]
{:status (or status 200)
:headers {"Content-Type" "application/edn"}
:body (pr-str {:1 "hi"})})