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
struct Daterange | |
def self.adapter | |
Lucky | |
end | |
module Lucky | |
alias ColumnType = UInt8 | |
include Avram::Type | |
def parse(value : UInt8) |
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/inputs/collection_check_boxes_input.rb | |
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput | |
def item_wrapper_class | |
"checkbox-inline" | |
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
# Based on | |
# https://github.com/ng/paperclip-watermarking-app/blob/master/lib/paperclip_processors/watermark.rb | |
# Modified by Laurynas Butkus | |
module Paperclip | |
class Watermark < Processor | |
# Handles watermarking of images that are uploaded. | |
attr_accessor :format, :whiny, :watermark_path, :position | |
def initialize file, options = {}, attachment = nil |
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
pdf_info = { | |
"John"=>{"format_b"=>{"file_z"=>{:quantity=>1, :free=>false}, "file_f"=>{:quantity=>1, :free=>true}}}, | |
"Brunto"=>{"format_a"=>{"file_w"=>{:quantity=>1, :free=>false}, "file_g"=>{:quantity=>1, :free=>true}}} | |
} | |
new_pdf_info = {} | |
pdf_info = pdf_info.sort_by {|k| k} | |
pdf_info.each do |customer, format_orders| |
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
In my application.rb : | |
config.i18n.available_locales = [:fr, :en, :nl, :es] | |
My routes : | |
scope "(:locale)" do | |
root :to => "home#index" | |
devise_for :users, :controllers => {:registrations => 'registrations'} | |
get '/home/test' => 'home#test', :as => 'home_test' |
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
NoMethodError in RailsAdmin::MainController#dashboard | |
undefined method `limit' for 0.0.5:Class | |
/home/brunto/.rvm/gems/ruby-1.9.3-p125@rails32x/bundler/gems/rails_admin-220745475c18/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb:47:in `latest' | |
/home/brunto/.rvm/gems/ruby-1.9.3-p125@rails32x/bundler/gems/rails_admin-220745475c18/lib/rails_admin/config/actions/dashboard.rb:17:in `block (2 levels) in <class:Dashboard>' | |
(eval):8:in `instance_eval' | |
(eval):8:in `dashboard' | |
actionpack (3.2.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action' | |
actionpack (3.2.6) lib/abstract_controller/base.rb:167:in `process_action' | |
actionpack (3.2.6) lib/action_controller/metal/rendering.rb:10:in `process_action' |