Skip to content

Instantly share code, notes, and snippets.

@ChrisSki
ChrisSki / dashboard.rb
Created August 22, 2013 16:33
town list within state
ActiveAdmin.register_page "Dashboard" do
#controller do
# @states = State.all
# @town = Town.all
#end
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
content :title => proc{ I18n.t("active_admin.dashboard") } do
@ChrisSki
ChrisSki / state.rb
Last active December 21, 2015 13:39
Associations
ActiveAdmin.register State do
index do
column :name
column "Associated Towns" do |state|
ul do
state.towns.each do |town|
li link_to(town.name, admin_town_path(town))
end
end
@ChrisSki
ChrisSki / full-trace-error
Created August 25, 2013 16:41
Filepicker.io Full Trace error
filepicker-rails (0.1) lib/filepicker/rails/configuration.rb:7:in `api_key'
filepicker-rails (0.1) lib/filepicker/rails/form_builder.rb:9:in `filepicker_field'
app/admin/geography.rb:29:in `block (3 levels) in <top (required)>'
/Users/***/.rvm/gems/ruby-2.0.0-p0@Guides/bundler/gems/active_admin-72a9c30cef47/lib/active_admin/form_builder.rb:156:in `block in field_set_and_list_wrapping'
actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `capture'
formtastic (2.3.0.rc2) lib/formtastic/helpers/fieldset_wrapper.rb:32:in `field_set_and_list_wrapping'
/Users/***/.rvm/gems/ruby-2.0.0-p0@Guides/bundler/gems/active_admin-72a9c30cef47/lib/active_admin/form_builder.rb:155:in `field_set_and_list_wrapping'
formtastic (2.3.0.rc2) lib/formtastic/helpers/inputs_helper.rb:292:in `inputs'
Verifying that +csciolla is my openname (Bitcoin username). https://onename.io/csciolla
@ChrisSki
ChrisSki / loop.js
Last active December 20, 2015 20:36
var arr = [
{
"name": "Baked Mac and Chees",
"ingredient": ["1 cup cheese", "1 lb macaroni", "1 cup milk"]
},
{
"name": "Chicken Parm",
"ingredient": ["2 lbs chicken", "1 cup breadcrumbs", "3 cups marinara", "1 cup mozarella", "1 tsp salt / pepper"]
},
...

Keybase proof

I hereby claim:

  • I am ChrisSki on github.
  • I am csciolla (https://keybase.io/csciolla) on keybase.
  • I have a public key whose fingerprint is E14D AF8B 2FDE 5FF4 8DFE 915E 0634 6166 3077 D9B7

To claim this, I am signing this object:

@ChrisSki
ChrisSki / frontmatter.rb
Last active November 30, 2016 01:13
Jekyll - Parse YAML frontmatter in a string
module Jekyll
module YamlParser
def yamlparser(string = '', options = {})
options = {delimiter: '---', parser: YAML, remove: nil}.merge(options)
# convert string params to symbols
options = options.inject({}) {|memo, (k,v)| memo[k.to_sym] = v; memo}
@delimiter = options[:delimiter]