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
Processing SessionsController#create (for 127.0.0.1 at 2010-03-03 12:57:48) [POST] | |
Parameters: {"openid_url"=>"", "commit"=>"Login", "action"=>"create", "authenticity_token"=>"2SCDKJ4hIlBqDKc/XsRFT80WS2373+YozHhXmuZK5GI=", "controller"=>"sessions", "login"=>"admin", "password"=>"[FILTERED]"} | |
[4;35;1mPreference Load (0.3ms)[0m [0mSELECT * FROM `preferences` [0m | |
[4;36;1mPage Load (0.3ms)[0m [0;1mSELECT * FROM `pages` [0m | |
[4;35;1mTag Load (0.2ms)[0m [0mSELECT * FROM `tags` [0m | |
[4;36;1mCategory Load (0.1ms)[0m [0;1mSELECT * FROM `categories` [0m | |
[4;35;1mLink Load (0.1ms)[0m [0mSELECT * FROM `links` [0m | |
[4;36;1mArticle Load (0.7ms)[0m [0;1mSELECT DISTINCT YEAR(created_at) AS `year`, MONTHNAME(created_at) AS `month_name`, MONTH(created_at) AS month, count(id) as articles FROM `articles` GROUP BY YEAR(created_at), MONTH(created_at) ORDER BY created_at DESC LIMIT 12[0m | |
[4;35;1mMenu Load (0.2ms)[0m [0mSELECT * FROM `menus` LIMIT 1[0m | |
[4;36;1mMenuItem Load (0 |
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
class Category < ActiveRecord::Base | |
has_many :products | |
attr_accessible :name, :type | |
CATEGORY_TYPES = %w[Product Sale] | |
validates_inclusion_of :type, :in => CATEGORY_TYPES | |
named_scope :of_products, :conditions => ["type = ?", "Product"] | |
named_scope :of_sales, :conditions => ["type = ?", "Sale"] | |
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
# lib/active_admin_views_pages_base.rb | |
class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document | |
private | |
# Renders the content for the footer | |
def build_footer | |
div :id => "footer" do | |
para "Copyright © #{Date.today.year.to_s} #{link_to('Example.com', 'http://example.com')}. Powered by #{link_to('Active Admin', 'http://www.activeadmin.info')} #{ActiveAdmin::VERSION}".html_safe |
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/admin/administration.rb | |
ActiveAdmin.register Manager do | |
menu :parent => "Administration" | |
end | |
ActiveAdmin.register Backup do | |
menu :parent => "Administration" | |
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
# lib/active_admin_filter_form_builder.rb | |
class ActiveAdmin::FilterFormBuilder | |
protected | |
def filter_string_input(method, options = {}) | |
field_name = "#{method}_contains" | |
[ label(field_name, "#{method.to_s.titlecase}"), |
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
# install Ruby 1.9.3 and Rails 3.2.1: | |
# ----------------------------------- | |
rvm install ruby-1.9.3-p0 | |
rvm use ruby-1.9.3-p0 --default | |
gem update --system | |
gem update rake | |
gem install bundler | |
gem install rails | |
# in your project directory: |
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
# Install libxml2 using Homebrew | |
# If you don't have Homebrew, follow the instructions at: | |
# https://github.com/mxcl/homebrew/wiki/Installation | |
# ------------------------------------------------------- | |
brew install libxml2 | |
# Install libxslt from source code | |
# If you don't have wget, follow the instructions at: | |
# http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html | |
# Or use Homebrew: |
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
namespace :routes do | |
desc 'Print out all defined routes in match order, with names, per constraint class. Target specific constraint class with CONSTRAINT=x. Target specific controller with CONTROLLER=x.' | |
task constrained: :environment do | |
Rails.application.reload_routes! | |
constraints_routes = Hash.new | |
Rails.application.routes.routes.each do |route| | |
group = (route.app.class == ActionDispatch::Routing::Mapper::Constraints ? route.app.send( :constraints ).first.to_s : 'No constraint class') | |
constraints_routes[group] ||= [] |
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
.hero | |
%h1 Ripples | |
%p This is a cool little mixin I made in SCSS for button animations. Hover over the buttons to see the magic! I hope you like it and I hope it comes in handy for you! | |
%h1 Usage | |
%p Usage: Just @include ripples on the button element or any classes you want the animation to be applied. The mixin takes in three parameters, colour, growth field and the size of the button | |
%a{'href' => 'https://github.com/Jackthomsonn/ripples', 'target' => '_blank'} Get Ripples | |
.container |
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
<div class="request-loader"> | |
<span>👋</span> | |
</div> |
OlderNewer