Added the Rails code

Added the Rail code. Only the search function is remaining. And a
special case in the processing of a spectra is left out.