Skip to content

Instantly share code, notes, and snippets.

View jackdesert's full-sized avatar

Jack Desert jackdesert

View GitHub Profile
@jackdesert
jackdesert / breadcrumb_helper.rb
Last active December 14, 2015 16:48 — forked from sprsquish/gist:445553
A helper method that creates a breadcrumb based on your current url
module Admin::BreadcrumbHelper
# BREADCRUMB HELPER
#
# This module is useful anywhere you want to create a basic bread crumb
# I generally use it
# INSTALLATION for ADMIN DASHBOARD
# 1. Save this file to app/helpers/admin/breadcrumb_helper
#
# INSTALLATION for NORMAL USE
# 1. Save this file to app/helpers/breadcrumb_helper
@jackdesert
jackdesert / gist:7090731
Last active December 26, 2015 04:09 — forked from hungpk/gist:5098340
This monkey patch of rails_admin allows me to set the timezone for rails_admin models explicitly, while the rest of the app runs on utc.
require 'rails_admin/config/fields/base'
module RailsAdmin
module Config
module Fields
module Types
class Datetime < RailsAdmin::Config::Fields::Base
def value
value_in_default_time_zone = bindings[:object].send(name)