Generate PDF Using Rails and Flying Saucer

Rails Pdf Plugin act_as_flying_saucer There are various ways to generate pdf documents in any language.In Rails we can use prawn library ,HtmlDoc,PrinceXml and many other library,using their api we can generate pdf document.Basically the primary goal is converting HTML web pages to PDF Document,without much changing existing CSS and HTML. Using the Flying Saucer Project we can achieve this.we can convert HTML + CSS to PDF documents without much changing HTML and CSS. It also support CSS 2 and many

Continue Reading

Rails Observer

Observer classes respond to lifecycle callbacks to implement trigger-like behavior outside the original class. This is a great way to reduce the clutter that normally comes when the model class is burdened with functionality that doesn‘t pertain to the core responsibility of the class. In my project,I have to track certain action (create and update) of user on particular model basically i am maintaining some kind of log, or audit trails.In my application eventlog model has attribute user and body.

Continue Reading

Multiple database in rails

In normal rails application contain one database,but if we want rails application having more than one database that is multiple data base.   we can achieve this using multiple way.one of the way is i am showing here.it’s just 3 steps. Lets take an e.g Project has many milestone and milestone has many task In normal scenario model looks like following way class Project < ActiveRecord::Base has_many :milestones end   class Milestone < ActiveRecord::Base has_many :tasks belongs_to :project end  

Continue Reading

Site Footer