Rails gem therubyracer installation error: extconf.rb:10:in `’: Error compiling V8 (RuntimeError)

It is because of you have already the old version of therubyracer is in your project. And that version depends on a libv8 gem, thats why it is getting error so, uninstall the libv8 gem and install the therubyracer again

$ gem uninstall libv8
$ gem install therubyracer
Advertisements

A Simple example of Using iframe in Rails

Write the code for iframe and in the src option give the path that defined in routes. It will render the file which corresponding action of the controller renders.

An Haml example is given below:

%iframe{:align => "center", :name => "window", :src => "#{list_make_shipments_path(:ids => "#{@shipment_success_responses.collect(&:id).join(",")}")}", :height => "1000px;", :width => "1100px;", :style => "float:left;margin-top:30px;"}

Create an Image from base64 encrypted image digest data

Suppose you have a base64 digest data of an image, how are you going to display it in your website?

For example You an encrypted image data like this : PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR…

Here is an example in haml, how to display the image from this data ( you can make corresponding HTML from this if you are using a Html file)


%img{:alt => "File Icon", :src => "data:image/gif;base64,PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR...", :style => "float: left;margin-top:200px;", :id => "my_image_id", :class =>"blahblahblah"}