Ruby-on-rails – iframe src in Haml

hamlrubyruby-on-rails

I always get an empty page when using an iframe. I put, in src, the location of the Haml file containing the code to create the checkboxes:

view.haml:

%iframe{:src => "file:///home/marina/project/app/views/blog_posts/new2.haml"}

new2.haml:

%h1 popup
br
%input{:name => "option1", :type => "checkbox", :value => "Milk"}
Milk
%br
%input{:name => "option2", :type => "checkbox", :value => "Butter"}
Butter
%br
%input{:name => "option3", :type => "checkbox", :value => "Cheese"}
Cheese
%br

Best Solution

Try :

If files on same place

%iframe{:src => "blog_posts/new2.haml"}

else suggest to use it as :

make a routes for new2 action and call into iframe via url like :

%iframe{:src => "http://yourdomain.com/new2"}