Oct 24

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 1.9.2 after precomplied step pdf.
By default pdf is generated on system /tmp directory.
In heroku we can set application tmp path to generate pdf i.e ./tmp

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 rails is hanging

After litte bit of googling  i figure out it is external style sheet causing an issue because of asset pipeline and thread issue for serving static file mainly in dev mode.

So i simply pre complied css or we can manually (actual full path) or manipulate asset path .after this PDF is generated properly.

Now it is time to test on Heroku.I am using cedar stack and ruby 1.9.2 after pre complied step.

Now point tmp directory to application tmp directory.

ActsAsFlyingSaucer::Config.options = {:tmp_path => "./tmp"}
Tagged with:
Aug 30

Well long break,Let me guess It over 3 month since I wrote my last post. I’ve been kind of  busy lately not manage to dedicate much time to thing that I do.

Rails 3.1.0 is been in picture for a quite a while a now and major feature that been included in Rails 3.1.0 is asset pipeline and pre-processor.

For those is who aren’t aware of Rails 3.1.0 asset pipeline and pre-processor there is a very good article on rails guide and recently Ryan Bates introduce a screencast on Rails 3.1.0 asset pipeline.

I’m not here to talk about asset pipeline you can get it all if you just googled it.

So what I’m here upto then ? :)

Well ever since I was made aware of what asset pipeline  and pre-processor more importantly pre-processor ,it always trilled me of using a custom pre-processor .

As you all know that Rails 3.1.0.rc1 is bundle with coffee-script and sass support. In your asset folder you may find js and css file that look something like this “*.js.coffee” , “*.css.scss“. Now you can add a chain of pre-processor that just look like this “*.js.coffee.erb” , “*.css.scss.erb

The post is all about chaining your own pre-processor just as above something like “*.js.coffee.mustache

Mustache (Mustache is taken just for example here you can use your own) because I been in love with it ever since I explored it . So how to accomplish this .

Stay with me as I will show how ?

Firstly you need to be aware of Sprockets and Tilt library

First the code

Continue reading »

preload preload preload