Skip to content

Instantly share code, notes, and snippets.

View Choongkyu's full-sized avatar

Choongkyu Kim Choongkyu

View GitHub Profile
count =0
for animal in %w{yes no maybe certainly definitely of course} do
puts animal
break if count == 10
count += 1
retry if animal == 'of'
end
WARN: Unresolved specs during Gem::Specification.reset:
rack (>= 1.4.5)
rack-test (~> 0.6.1)
thor (< 2.0, >= 0.15.2)
activesupport (~> 3.2.6)
ffi (>= 0.5.0)
i18n (~> 0.6.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
e:/ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `
<title>Shared Todo App</title>
<div class='container'>
<div class='row'>
<div class='span4'>
<h1>Shared Todo App</h1>
<hr>
<%= form_for @todo do |i| %>
<%= i.text_field :name %>
<%= i.submit %>
<% end %><!--do1-->
@Choongkyu
Choongkyu / gist:8fdf15f1d9b9d89b3a4f
Created September 16, 2014 15:35
todos_controller
class TodosController < ApplicationController
def index
@todoAll = Todo.all
@todo = Todo.where(completed:false)
@completes = Todo.where(completed:true)
end
def todoParams
params.require(:todo).permit(:name, :completed)
@Choongkyu
Choongkyu / application.html.erb
Last active August 29, 2015 14:06
blog attempt
<!DOCTYPE html>
<html>
<head>
<title>BlogRailsguides</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
C:\Users\Guy\code\vist-testbed-searchedit>rake db:migrate --trace
rake aborted!
NotImplementedError: NotImplementedError
C:/jruby-1.7.16/lib/ruby/gems/shared/gems/railroady-1.1.0/tasks/railroady.rake:3
4:in `sed'
C:/jruby-1.7.16/lib/ruby/gems/shared/gems/railroady-1.1.0/tasks/railroady.rake:4
7:in `(root)'
C:/jruby-1.7.16/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/task_manager.rb:2
09:in `in_namespace'
@Choongkyu
Choongkyu / fruit_controller.rb
Last active August 29, 2015 14:07
fruit issues
class FruitsController < ApplicationController
before_action :set_fruit, only: [:show, :edit, :update, :destroy]
# GET /fruits
# GET /fruits.json
def index
@food = Food.find(params[:food_id])
@fruits = @food.fruits.all
end
@Choongkyu
Choongkyu / stack trace
Created October 6, 2014 01:00
rotten fruit
NoMethodError in Fruits#new
Showing C:/Users/Guy/code/food/app/views/fruits/_form.html.erb where line #1 raised:
undefined method `fruits_path' for #<#<Class:0x46b9d20>:0x38c6df0>
Extracted source (around line #1):
1
2
3
4
@Choongkyu
Choongkyu / stacktrace
Created October 6, 2014 02:43
fruity error
NoMethodError in FruitsController#create
undefined method `fruit_url' for #<FruitsController:0x2d2c3e8>
Extracted source (around line #33):
@Choongkyu
Choongkyu / stack trace
Last active August 29, 2015 14:07
urlgeneration error
NameError in Articles#show
Showing C:/Users/Guy/code/blog/app/views/articles/show.html.erb where line #31 raised:
undefined local variable or method `article' for #<#<Class:0x3c05088>:0x3b69058>
Extracted source (around line #31):
28
29
30
31
32