# HTML embed tag and rails

**URL:** <https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092>\
**Category:** Rails\
**Created:** [June 18, 2007, 2:40am UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092 "2007-06-18T02:40:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [June 18, 2007, 2:40am UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092/1 "2007-06-18T02:40:23Z")

</div>

I have an embeded pluggin that I must use inside my RoR app.

We have set up an application.rhtml page that renders the top, side menu  
and center of the application for every page via DIV’s. This works  
great.

The problem… This embeded plugin is a Third party plugin that they have  
just created for the Mac OSX and Safari and every time I load the page,  
it re-loads the plugin and the software it is communicating with. In my  
app, I need to lookup the name of person. So, I type their name and hit  
enter. The plugin loads with the results. I type in the next persons  
name, the plug unloads and reloads with the results… and so on.

This is shouting a hidden frame to me, but I’m not so sure that is the  
best way to go w/ RoR.

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [June 18, 2007, 9:51am UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092/2 "2007-06-18T09:51:03Z")

</div>

i don’t see anything wrong with an iframe, if that supplies your needs,  
but maybe someone out there can correct me

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [June 18, 2007, 12:06pm UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092/3 "2007-06-18T12:06:36Z")

</div>

Hi, could you please provide some information about your environment?  
In any case, it seems that you’re working in development mode. If  
this is the case, then application source code will be reloaded for  
each request. However, this isn’t the case in production because  
they are loaded once.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [June 18, 2007, 12:35pm UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092/4 "2007-06-18T12:35:42Z")

</div>

shai wrote:

> i don’t see anything wrong with an iframe, if that supplies your needs,  
> but maybe someone out there can correct me

How would you implement the iframe in a way that does not cause the  
 tag to reload every time? Maybe that is what the iframe deos by  
nature…??

---

<div class="post-metadata">

**Author:** ![john\_old](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9f8e36/32.png) [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Post date:** [June 18, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/html-embed-tag-and-rails/107092/5 "2007-06-18T12:42:59Z")

</div>

Conrad T. wrote:

> Hi, could you please provide some information about your environment?  
> In any case, it seems that you’re working in development mode. If  
> this is the case, then application source code will be reloaded for  
> each request. However, this isn’t the case in production because  
> they are loaded once.
> 
> Good luck,
> 
> -Conrad

You are correct. But really my problem isn’t at the rhtml layer. My  
problem is at the html layer. The tag needs to be loaded once  
throughout the life of the session, not after every page refres

In a nutshell. On XP, for IE and FF there exists a XPCOM object that  
gets called from javascript. This communicates with the printer software  
and sends a label to be printed to the label printer w/o having to bring  
up label printer software and being forced to click on print via the  
print dialog. Its a 1-click process. Very simeple.

I am trying to accomplish this feat on the Mac. The printer company has  
created a plugin for safari, but the plugin has the tag. This  
tag loads the printer softwere into memory every time and pops up the  
gui. Not a good solution when most of the time is spent in 1 screen  
doing queries over and over.

The printer company has an SDK that talks applescript. Is there a way to  
call applescript from javascript?
