Some CoffeeScript (verbosely commented for clarity)
# Override Rails handling of confirmation
$.rails.allowAction = (element) ->
# The message is something like "Are you sure?"
message = element.data('confirm')
Pry.config.auto_indent = true | |
Pry.config.color = true | |
Pry.config.editor = "vim" | |
#Pry.config.prompt = Pry::DEFAULT_PROMPT | |
Pry.config.history.file = "~/pry_history" | |
Pry.config.hooks.add_hook(:before_session, :say_hi_lazza) do | |
puts "\n\nHi Traz !\nRuby#{RUBY_VERSION}\n\n" | |
end | |
Pry.config.hooks.add_hook(:after_session, :say_bye_lazza) do | |
puts "\n\nbye-bye Traz !\n\n" |
@echo off | |
SET BOOTSTRAP=.\docs\assets\css\bootstrap.css | |
SET BOOTSTRAP_LESS=.\less\bootstrap.less | |
SET BOOTSTRAP_RESPONSIVE=.\docs\assets\css\bootstrap-responsive.css | |
SET BOOTSTRAP_RESPONSIVE_LESS=.\less\responsive.less | |
SET "CHECK= " | |
SET HR=################################################## | |
::Try to use the local build tools, if installed instead of global ones |
@import "compass/css3/box-shadow" | |
@import "compass/css3/transition" | |
$bs-box-shadow-default-color: rgba(0, 0, 0, 0.075) | |
$bs-box-shadow-focus-color: rgb(82, 168, 236) | |
@mixin bs-default-box-shadow | |
@include box-shadow(inset 0 1px 1px $bs-box-shadow-default-color) | |
@mixin bs-box-shadow |
// jQuery.FullScreen plugin | |
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy! | |
(function($) { | |
function isFullScreen() { | |
return document[!prefix ? 'fullScreen' : | |
'webkit' === prefix ? 'webkitIsFullScreen' : | |
prefix + 'FullScreen']; | |
} |
Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.
So instead of this:
require 'carrierwave/processing/mini_magick'
=semantic_form_for [:admin, @dog], validate: true, html: {multipart: true} do |f| | |
=f.inputs do | |
=f.input :name | |
=f.input :kennel_name | |
=f.input :birthdate | |
=f.input :gender, as: :radio, collection: {'Tik' => 'F', 'Hane' => 'M'} | |
=f.input :father_id, as: :select, collection: @dogs | |
=f.input :mother_id, as: :select, collection: @bitches | |
=f.semantic_fields_for :pictures do |pic| |