This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# active_admin and formtastic seem kinda picky about displaying both the | |
# image and the file input together here... in fact, it seems like this | |
# is the ONLY way to do this? Adding anything else after the image_tag squashes it. | |
ActiveAdmin.register Film do | |
form do |f| | |
f.inputs "Film" do | |
f.input :title | |
end | |
f.has_many :stills do |film_still_form| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initializers/active_admin.rb | |
module ActiveAdmin | |
class OrderClause | |
alias_method :initialize_old, :initialize | |
alias_method :valid_old?, :valid? | |
alias_method :to_sql_old, :to_sql | |
def initialize(clause) | |
if clause.class == String | |
initialize_old(clause) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want to monkey patch every controller, put this in initializers/active_admin.rb | |
ActiveAdmin::ResourceController.class_eval do | |
include ActiveAdmin::CSVStream | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It extends activeadmin to show pretty boolean values | |
# | |
# config/initializers/active_admin.rb | |
module ActiveAdmin | |
module Views | |
class TableFor | |
def bool_column(attribute) | |
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if defined?(ActiveAdmin) | |
require 'active_admin/views' | |
require 'active_admin/views/components/panel' | |
module ActiveAdmin | |
module PaperTrail | |
module Views | |
class Versions < ActiveAdmin::Views::Panel | |
builder_method :active_admin_paper_trail_versions_for | |
attr_accessor :resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveAdmin | |
module Inputs | |
class FilterCountryInput < FilterSelectInput | |
include FilterBase | |
def collection | |
::ActionView::Helpers::FormOptionsHelper::COUNTRIES | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app / assets / javascripts / active_admin.js | |
//= require active_admin/base | |
//= require jquery.ui.widget | |
//= require jquery.iframe-transport | |
//= require jquery.fileupload | |
//= require cloudinary/jquery.cloudinary | |
//= require attachinary | |
//= require attachments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sortable-item | |
cursor: move // IE fallback | |
cursor: -webkit-grab // Chrome and Safari fallback | |
cursor: grab | |
&.ui-sortable-helper | |
cursor: move // IE fallback | |
cursor: -webkit-grabbing // Chrome and Safari fallback | |
cursor: grabbing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby '2.2.0' | |
source 'https://rubygems.org' | |
... | |
gem 'font-awesome-rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/assets/javascripts/active_admin.js.coffee | |
#= require active_admin/base | |
ActiveAdmin = { | |
dashboard: {}, | |
user: {} | |
} | |
ActiveAdmin.dashboard.index = () -> | |
console.log 'Hello' |