Apparently in Rails you need to manually set the MIME-Type of attachments, otherwise their filesize, filetype and other Metadata are not properly recognized by the E-Mail client and images will not be displayed within the html e-mail.
In this case using the hash :mime_type and the corresponding value 'image/png' in the rails controller solved this problem:
attachments.inline["img.png"] = {:data => File.read('img.png'), :mime_type => 'image/png'}
Ruby on Rails (RoR) is a trendy, rather new software framework on the brink of usefulness for professional development. The modular character of this framework allows users to easily contribute software packages in the form of Ruby Gems, which provide invaluable help with the professional deployment of RoR-software.
The following gems are, in my experience, most valuable:
1) Gems for Development
Download here. Brakeman is an open source vulnerability scanner specifically designed for Ruby on Rails applications. It statically analyzes Rails application code to find security issues at any stage of development.
Download here. A robust Ruby code analyzer, based on the community Ruby style guide. It helps with efficiently finding code passages of possible brisance.
2) Gems for Testing
Download here.RSpec is testing tool for the Ruby programming language. Born under the banner of Behaviour-Driven Development, it is designed to make Test-Driven Development a productive and enjoyable experience.
Download here. A library for efficiently setting up Ruby objects as test data.
Download here. Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.
Download here. Code coverage for Ruby 1.9+ with a powerful configuration library and automatic merging of coverage across test suites. It helps with determining how much of your code is covered by tests.
3) Gems for Deployment
Download here. A remote server automation and deployment tool written in Ruby.
Preconditions:
1. Step: Sign up for heroku
The very first step is to sign up for an heroku account. Heroku provides on free web instance which should be enough for most production needs.
Signing up can be done here: https://api.heroku.com/signup/devcenter
Step 2: Install the Heroku Toolbelt
The next step is to install the heroku toolbelt. It provides a lot of different command line commands which can be used to interact with heroku including:
The toolbelt can be downloaded here: https://toolbelt.heroku.com/
Step 3: First login
The next step is to do a first login using the heroku login command on the command line. If no ssl key was provided it is possible to create one now.
Step 4: Create the app on Heroku
The next step is to create an application on heroku. This application already includes one free web instance.
The task can be accomplished by running the toolbelt command heroku create on the commant line.
Step 5: Deploy
The last step is to actually deploy the application which can be done by running the command git push heroku master.
the easiest way imho is ti use the spawn plugin.
download from: http://rubyforge.org/frs/?group_id=4646
usage is dead simple. just wrap the code to run in the background around 'spawn' like this:
spawn do
# code to run in background
end
more advanced solutions with full scale scheduling etc... might be using:
rufus-scheduler: http://rufus.rubyforge.org/rufus-scheduler/
backgroundRb: http://backgroundrb.rubyforge.org/
use pdf:writer gem:
http://ruby-pdf.rubyforge.org/pdf-writer/
usage:
pdf = PDF::Writer.new
pdf.select_font "Times-Roman"
pdf.text "Halli hallo!", :font_size => 72, :justification => :center
pdf.save_as("hello.pdf")
use the classifier gem from
http://classifier.rubyforge.org/
usage:
b = Classifier::Bayes.new 'A', 'B'
b.train_A "diese worte sind eindeutig A"
b.train_B "und alles sonst B"
b.classify "alles alles" # returns B
you can train the classifier based on already tagged content.