How to reload a gem on every request in Development mode? [closed]

This solution almost works but for some reason I have to put it into application.rb and not in environments/development.rb otherwise the autoload_paths are not recognized. I added some additional stuff which fetches the paths automagically. if Rails.env.development? reload_gems = %w(my_gem other_gem) # names of gems which should autoreload config.autoload_paths += Gem.loaded_specs.values.inject([]){ |a,gem| a += gem.load_paths … Read more

Rails – How to test that ActionMailer sent a specific attachment?

Here’s an example that I copied from my rspec test of a specific attachment, hope that it helps (mail can be creating by calling your mailer method or peeking at the deliveries array after calling .deliver): mail.attachments.should have(1).attachment attachment = mail.attachments[0] attachment.should be_a_kind_of(Mail::Part) attachment.content_type.should be_start_with(‘application/ics;’) attachment.filename.should == ‘event.ics’

Bind Ckeditor value to model text in AngularJS and Rails

CKEditor does not update textarea while typing, so you need to take care of it. Here’s a directive that will make ng-model binding work with CK: angular.module(‘ck’, []).directive(‘ckEditor’, function() { return { require: ‘?ngModel’, link: function(scope, elm, attr, ngModel) { var ck = CKEDITOR.replace(elm[0]); if (!ngModel) return; ck.on(‘pasteState’, function() { scope.$apply(function() { ngModel.$setViewValue(ck.getData()); }); }); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)