# Converting Rails app to desktop with XUL?

**URL:** <https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562>\
**Category:** Rails\
**Created:** [March 21, 2007, 10:41am UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562 "2007-03-21T10:41:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 10:41am UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/1 "2007-03-21T10:41:19Z")

</div>

Hi,  
We are thinking about choosing Rails as our weapon of choice for our  
next project, which is basically a text editor on steroids, whith some  
functionality that need an Internet connection.

In the first step we are going to develop it as a plain web app  
(AJAX-ified, yay!), however, in the next step we would like to port some  
of the functionality (such as the editor) to a desktop app (which can be  
used without Internet connectivity).

I’ve read about XUL and I was wondering if anyone has any experience of  
“converting” a Rails project to the desktop using XUL, and keeping Rails  
as a backend? Or maybe there’s a better tool than XUL?

Best regards and thanks for any help,  
Gustav

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 11:20am UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/2 "2007-03-21T11:20:54Z")

</div>

I was wondering whether someone could show me how to dynamically set the  
the ‘id’ attribute in the ‘body’ tag. I would like to set the id to  
controller name (in lowercase) using embedded ruby.

cheers

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 11:43am UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/3 "2007-03-21T11:43:10Z")

</div>

There is project cookbooxul as proof of concept XUL ↔ rails by Zed  
Shaw.

[http://www.zedshaw.com/projects/cookbooxul/index.html](http://www.zedshaw.com/projects/cookbooxul/index.html)  
Just to warn, download links are not good.

I know that I have tried this online and seems to me as a really  
interesting concept.

Regards, Ernad

–  
Posted via forums.bring.out.ba.

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 11:44am UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/4 "2007-03-21T11:44:10Z")

</div>

> I was wondering whether someone could show me how to dynamically set the  
> the ‘id’ attribute in the ‘body’ tag. I would like to set the id to  
> controller name (in lowercase) using embedded ruby.

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 12:01pm UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/5 "2007-03-21T12:01:05Z")

</div>

Googling directed me to the Joseph’s blog:

- [http://www.josephguhlin.com/blog/archives/category/xul/](http://www.josephguhlin.com/blog/archives/category/xul/)

Ernad

–  
Posted via forums.bring.out.ba.

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 1:31pm UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/6 "2007-03-21T13:31:18Z")

</div>

> thxs Rimantas. Just tried it and it works a treat. So basically i can  
> place \<%= %\> expression anywhere within quotes and it will get evaluated  
> before generating the XHTML.

Well, in this case it just happen that you need to have output  
something between quotes.  
In templates you can use ERB wherever you need.  
You may want to read ERB section here  
[http://api.rubyonrails.com/classes/ActionView/Base.html](http://api.rubyonrails.com/classes/ActionView/Base.html)  
and also “Recognized tags”  
[http://stdlib.rubyonrails.org/libdoc/erb/rdoc/classes/ERB.html](http://stdlib.rubyonrails.org/libdoc/erb/rdoc/classes/ERB.html)  
This should give you a general idea, how it works. Keep in mind that  
second link is to  
the general documentation of ERB, not rails specific.

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![Gvstav](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e47c2d/32.png) [@Gvstav](https://www.ruby-forum.com/u/Gvstav)\
**Post date:** [March 21, 2007, 12:32pm UTC](https://www.ruby-forum.com/t/converting-rails-app-to-desktop-with-xul/89562/7 "2007-03-21T12:32:32Z")

</div>

thxs Rimantas. Just tried it and it works a treat. So basically i can  
place \<%= %\> expression anywhere within quotes and it will get evaluated  
before generating the XHTML.

cheers
