...to automatically replace the content of $('#id'). To do the same in Rails 3, include usual rails-ujs JavaScript, and put this into your application.js: $(function() { $('[data-remote][data-replace...

github.com

...We create a new class ContactFilter that will describe the searchable columns: class ContactFilter include Minidusen::Filter filter :text do |scope, phrases| columns = [:name, :email] scope.where_like(columns => phrases)

...is only allowed to transfer files from a whitelist of paths that should not include /tmp. One solution for this is to save the tempfile in your project directory's...

...HTTP/1.1 200 OK ... ✔ > curl -i --tlsv1 https://www.econda-monitor.de/els/logging HTTP/1.1 200 OK ... curl -i includes the protocol headers in the output, so you'll see the response's status code...

...means that you want a pattern to be preceded by another pattern, but not include the preceding pattern in your match or search cursor. E.g. (?<=x)y matches y in...

makandra dev

...a thread which caused the application to stop responding. Rails 4.x ActiveSupport::Dependencies includes logging support. It is easy to use: ActiveSupport::Dependencies.logger = Rails.logger Rails 5+ Logging support was...

stackoverflow.com

...for now, it shows a deprecation warning. Since Rails 3.2.14 and 3.2.15 did not include security updates, you might not have applied them and probably now encounter these deprecation warnings...

...logic how to roll back the initial migration.\ So, in your new migration, just include the old one and call it: require 'db/migrate/20120201031337_add_population_to_destinations' class DropPopulationFromDestinations < ActiveRecord::Migration def self.up AddPopulationToDestinations.down...

solnic.eu

...cool example. It allows you to inject some state into the module you are including elsewhere. Check it out! class AttributeAccessor < Module def initialize(name) @name = name end def included...

define_method(@name) do instance_variable_get("#{ivar}") end end end class Book include AttributeAccessor.new(:title) def title "#{super} + super works!" end end book = Book.new book.title = "Module Subclassing Guide...

github.com

JavaScript structures that include circular references can't be serialized with a"plain" JSON.stringify. Example: a = { name: 'Groucho' }; b = { name: 'Harpo', sibling: a }; a.sibling = b; Doing a JSON.stringify(a) will...

httpd.apache.org

Adding that to your site's vhost will create log files that include the current date in their name, like access.2011-04-20.log, without any need to restart the web server...

...modified_at" DESC NULLS LAST, "title"; PostgreSQL will only use your index, if it includes all columns, and all columns are order correctly (or if all columns are ordered reversely...

...but its contents will be kept. $container.html() // returns " Hello World" Also note that contents() includes text and comment nodes which is essential for this approach to work. jQuery usually won...

When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each line. I don't know when this happens, and most...

...is often useful in views where might think about writing [state_A, state_B].include? object.state (which you should not). Keep in mind that this will not call any validations...

makandra dev

...It also keeps the quality at the input level. Audio Removal Peek recordings will include any audio your device was playing during the recording. You can also use ffmpeg to...

...x), you need the mysql2 in a 0.2.x version. Newer versions no longer include the ActiveRecord adapter (which is part of ActiveRecord since Rails .1). So your Gemfile should...

...to its asset paths by default. This means that when you write this: <%= javascript_include_tag 'all.js' %> ... you always get the same path, regardless of the contents of all.js...

...validation in exactly this order ResourceController - here you have to be careful class PostController include ResourceController::Controller does 'post_controller/behavior' index.before { do_something } end module PostController::BehaviorTrait

...don't store the files local but remote (e.g. S3) the url will already include the full url...

...config/initializer/carrierwave.rb require 'carrierwave/processing/rmagick' ... and define a custom processor MyUploader.rb class MyUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick def cover manipulate! do |frame, index| frame if index.zero? # take only the first...

...for an ApplicationController requiring Aegis::Controller from the aegis gem: class ApplicationController < ActionController::Base include Aegis::Controller end In this case aegis must be listed before resource_controller in your...

...any characters outside the standard Latin-1 set. When browsers encounter a character not included in the current font, they use a fallback font for this one character. And that...

...current font. What you can do is to use an icon font that probably includes the symbol you are looking for...

...This will print all unused step definitions from your project – however, the result will include false positives. Steps that are exclusively called from other steps will be in the list...