In order of preference;
- [Event_Calendar] (https://github.com/elevation/event_calendar)
- Calendar_Helper
In order of preference;
# blog post: | |
# Before using this initializer, you must set up Cancan. First, add the gem to your Gemfile: | |
# | |
# gem 'cancan' | |
# | |
# Next, generate and edit an Ability class: | |
# | |
# rails generate cancan:ability | |
# |
##References
##Create Rails App
command to make new directory:
mkdir AppName
# config/initializers/active_admin.rb | |
ActiveAdmin.setup do |config| | |
config.current_user_method = :current_user | |
config.authentication_method = :authenticate_user! | |
config.before_filter :admin_role_filter | |
end | |
# Adding all recource names to Permissions table after ActiveAdmin is loaded |
ActiveAdmin::Dashboards.build do | |
# Add this section in your dashboard... | |
section "Background Jobs" do | |
now = Time.now.getgm | |
ul do | |
li do | |
jobs = Delayed::Job.where('failed_at is not null').count(:id) | |
link_to "#{jobs} failing jobs", admin_jobs_path(q: {failed_at_is_not_null: true}), style: 'color: red' | |
end |
ActiveAdmin.register_page "Dashboard" do | |
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") } | |
content :title => proc{ I18n.t("active_admin.dashboard") } do | |
# div :class => "blank_slate_container", :id => "dashboard_default_message" do | |
# span :class => "blank_slate" do | |
# span "Welcome to Active Admin. This is the default dashboard page." | |
# small "To add dashboard sections, checkout 'app/admin/dashboards.rb'" | |
# end |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
module ActiveAdmin | |
module Inputs | |
class FilterSelectInput < ::Formtastic::Inputs::SelectInput | |
def extra_input_html_options | |
{ | |
:class => 'chosen' | |
} | |
end | |
end | |
end |
<%= semantic_form_for @parent do |a| %> | |
<%= a.inputs "Family Details" do %> | |
<%= a.input :name %> | |
<%= a.input :user %> | |
<%= a.input :region %> | |
<% end %> | |
<%= a.inputs "Children" do %> | |
<table> |
require "pg" | |
require "redis" | |
words = File.read("/usr/share/dict/words").split "\n" | |
pgconn = PGconn.open :dbname => "test_hstore", :port => 5433, :user => "test_user", :password => "changeme" | |
redis = Redis.new | |
reps = [1,10,100,1000,10000] | |
pg_inserts = [] | |
pg_selects = [] | |
redis_sets = [] |