acts_as_flying_saucer on Rails 3.1 and Heroku

Just quick post how to use acts_as_flying_saucer with rails 3.1 and Heroku. I was testing acts_as_flying_saucer with rails 3.1.It is working fine so far. but when i have added external style sheet it was hanging on dev mode. and later on i figure out it is external style sheet causing an issue. So i precomplied css and then try to generate pdf it is working. Now it is time to test on heroku. I am using cedar stack and ruby

Continue Reading

Passing arrays using Net-http in Ruby

Hi all, We needed to use net/http of ruby for sending parameters between two modules. We decided to use the get and the post request of http as follows: url = URI.parse(“http://SERVER:PORT”) http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(“/method_name?parameter=a”) response = http.request(request) In the above get request the parameter “a” is taken to the “http://SERVER:PORT/method_name” and data related to it is queried. url = URI.parse(“http://SERVER:PORT”) http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Post.new(“/method_name”) request.set_form_data({“parameter1” => “a”, “parameter2” => “b”, “parameter3” =>

Continue Reading

Selenium in headless with Xvfb under RUBY

Today I will demonstrate how did I manage to get Selenium (browser => “firefox”) running under headless state (click here to know more on this) . Now we need Xvfb to accomplish this dirty task. For Ubuntu the package is fairly straight forward just type in the command . Under Fedora the same can be achieve using command . For more on Xvfb package  check your distribution provider .

Continue Reading

Amazon Simple Queing Service (SQS) + Ruby

Amazon Simple Queue Service (Amazon SQS) is a distributed queue messaging service. The idea of SQS is to remove the direct associations between producer and consumer and act as mediator between them. e.g Consider that you have a large  application like websites monitoring which involve many stages like Downloading a website Processing the downloaded website Generating report of the above processing So instead of clubbing the above three one can just split them on their specific need(based on the work

Continue Reading

Nailgun using ruby

In previous article we have seen that how to start nailgun server,and use of nailgun in shortly. Now in this article how to use nailgun using ruby application which directly/indirectly use java library or java application. You can start with nailgun manually as shown previous article and configure ng as per need.Or you can install nailgun plugin from github.

Continue Reading

Generate Bookmark for PDF using act_as_flying_saucer

In previous article we have seen that how pdf is generated  using act_as_flying_saucer plugin. Following code snippets is used for generating pdf with bookmark . <bookmark name=”section 1″  href=”#section_1″> tag is used to generate bookmark. which contains name attribute for displaying name of bookmark. href attribute is used for navigation purpose. <bookmark> tag can be nested so it can be used for generating nested bookmark <bookmark> tag is wrapper with <bookmarks> tag. This tag placed in html header. Now in

Continue Reading

Password protected pdf in rails using act_as_flying_saucer

Pdf with password protected in rails In previous article we have seen that how pdf is generated  using act_as_flying_saucer plugin. Now  act_flying_saucer  has added support for  password protected pdf. To generate PDF with password protection just pass :password=>”xxx” to render_pdf method. You can install act_as_flying_saucer plugin For  further details you can visit article or visit http://github.com/amardaxini/act_as_flying_saucer

Continue Reading

Vertical table in rails

In this article i have just taken a short example describing vertical table,and its implementation using rails. When table has no fixed column it has dynamic fields .data is not stored on separate column but data stores in vertical fashion. For implementing vertical table table has mainly 2 columns key and value pair.key is like database column name and value contains actual data. Lets take an e.g Consider website in which it contains various products and its comparison ,searching and

Continue Reading

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

Site Footer