Add one of the following formats to the end of the url
.json .xml
# This assumes you are using that you are using Active Admin from master. | |
# You can do this with 0.4.2 but you would need to override the HeaderRenderer instead | |
# config/initializers/active_admin.rb | |
ActiveAdmin.setup do |config| | |
# View a list of all the elements you can override | |
# https://github.com/gregbell/active_admin/blob/master/lib/active_admin/view_factory.rb | |
config.view_factory.utility_navigation = MyCustomUtilityNav |
#!/bin/bash | |
set -e | |
# Run the script: | |
# ./active-admin-run-tests-on-fork GITHUBUSERNAME BRANCHNAME | |
# Change this to wherever you want tests to run | |
tests_dir=~/code/personal/active_admin_forks |
#!/user/env ruby | |
# | |
# Batch gitmine review a bunch of tickets. | |
# | |
# Usage: ruby batch_review.rb 7585 7603 7623 7640 7663 7665 | |
# | |
ARGV.each do |issue_id| | |
system("gitmine checkout #{issue_id} && git pull && git diff master...HEAD") | |
puts "Merge into master?" |
ActiveAdmin.register Product do | |
# Will show the default main content... | |
show do | |
# Do stuff before | |
default_main_content | |
# Do stuff after | |
end | |
# ... Or if you want to customize further |
<% self.class.send :include, Arbre::HTML %> | |
<%= panel("Hello"){ h2 @test_assign } %> | |
<%= panel("Hello World"){ } %> |
module HasMoney | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
# | |
# has_money :default_price |
class FormBuilder | |
attr_reader :calls | |
def initialize(&block) | |
@calls = [] | |
@current = @calls | |
block.call(self) | |
end | |
// Assuming jQuery is on the page, this will append the search tweets | |
// to an element with the id of 'twitter' | |
$.getJSON("http://search.twitter.com/search.json?q=adobe+sucks&callback=?", function(data){ | |
$.each(data.results, function(i, tweet){ | |
var tweetContent = '<div class="tweet">'; | |
tweetContent += '<p class="tweet-body">' + tweet.text + '</p>'; | |
tweetContent += '<p class="tweet-meta"><a href="http://twitter.com/' + tweet.from_user + '">' + tweet.from_user + '</a> at ' + tweet.created_at + '</p></div>'; | |
$('#twitter').append(tweetContent); | |
}); | |
}) |
class Player < ActiveRecord::Base | |
has_many :game_participations | |
has_many :games, :through => :game_participations | |
end | |
class Game < ActiveRecord::Base | |
has_many :game_participations | |
has_many :players, :through => :game_participations | |
end |