# Ruby on Rails and WURFL?

**URL:** <https://www.ruby-forum.com/t/ruby-on-rails-and-wurfl/51989>\
**Category:** Rails\
**Created:** [January 9, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-wurfl/51989 "2006-01-09T22:50:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yooakim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/ac8455/32.png) [@yooakim](https://www.ruby-forum.com/u/yooakim)\
**Post date:** [January 9, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-wurfl/51989/1 "2006-01-09T22:50:40Z")

</div>

Hi!

I’m a newcommer to Ruby and Rails. I’ve just got the environment done on  
my Mac OS X machine and I am eager to start to learn more!

It seems as such a great plattform for doing webapplications.

I have a specific task I would like to acomplish but being a newbie with  
Rails and Ruby am not sure where to start.

What I want to do is to create a mobile site that is very goood at  
detecting which device is used for accessing the web application and  
then adjust the pages accroding to the devices capabilities.

Fortunately WURFL ([http://wurfl.sourceforge.net/](http://wurfl.sourceforge.net/)) is excellent at  
identifying the various devices. For the Java world there is a tag  
library (WALL - [http://wurfl.sourceforge.net/java/index.php](http://wurfl.sourceforge.net/java/index.php)) that  
implements a JSP tag library on top of WURFL - this makes it very easy  
to develop web applications that behave cleverly with the different  
devices out there. It handles WAP phones, XHTML browser and more.

The WURFL project has sometools and examples in Ruby

- [WURFL - Mobile Device Database by ScientiaMobile](http://wurfl.sourceforge.net/ruby/index.php).

My problems is that as a newbie to both Ruby and Rails i do not know  
where to start? Is there something similar to JSP TAG libs? If not, can  
you ecommend better approaches?

What I would like to do is to get the same ease-of-programming as if  
using the WALL JSP taglibs in a Java environmet.

Could anyone here help me plot a course for how to go about this?

Cheers,  
joakim  
Ã?kersberga  
Sweden

---

<div class="post-metadata">

**Author:** ![yooakim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/ac8455/32.png) [@yooakim](https://www.ruby-forum.com/u/yooakim)\
**Post date:** [January 10, 2006, 12:02am UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-wurfl/51989/2 "2006-01-10T00:02:02Z")

</div>

Hi, joakim,

java tag libraries - as you’ll know - are shortcuts to classes that  
render markup. If I define e.g. a tag named myTag and initialise it in a  
tld-File with it’s reference to the class my.namespace.MyTag which  
renders something like

- my list

then a simple reference like mytl:myTag will get the output of the  
rendering class and replace my directive with the rendered markup (here  
html but might as well be wml, xml et. al.), right?

IMHO (being a n00b myself) the rails equivalent to functionality like  
this are helpers (and components). In helpers you’ll define methods that  
render html and may be placed in your templates. Things aren’t very  
different. The learning curve for tld-Development is definitly steeper  
than developing helpers in rails. My approach to your problem therefore  
would be:

1. Researching if there are any native ruby libraries that provide  
functionality like wurfl
2. Researching what the wurfl project already provides for ruby
3. Rebuilding the WALL tld in rails helpers (probably quite a task): Is  
WALL open source? Then you would start at the tld-File, introspecting  
the Rendering-Classes that are referenced in the tld and build  
equivalent helpers in rails.

As a first step you might make yourself familiar with the rails  
rendering kit. Keywords are Templates, Partials, Helpers, Components

YMMV  
Jan

---

<div class="post-metadata">

**Author:** ![yooakim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/ac8455/32.png) [@yooakim](https://www.ruby-forum.com/u/yooakim)\
**Post date:** [January 11, 2006, 8:21pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-and-wurfl/51989/3 "2006-01-11T20:21:05Z")

</div>

Jan,

Thanks for the very helpful reply. I’ll get going with this and are very  
much looking forward to learn more about Rails and Ruby!

Seems like an excellent community this!

Cheers,  
Joakim
