[Logo] Menta Developers Blog
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
[Logo]
MentaOnRuby: Custom tags for RSP  XML
Forum Index » About Everything (English)
Author Message
saoj


[Avatar]

Joined: 13/12/2007 14:28:28
Messages: 26
Offline

The version 0.4b was released with some nice improvements. Thanks to Mauricio Linhares for the good tips. Here are the improvements:

Input, Output, Session, Application, Cookies now support the [] and []= methods to work like Ruby hashes.

So instead of:


You can have:

In the RSP (ERB file) you can now use the instance methods input, output, session, application, cookies and page.

Instead of:

You can do:

Support for MentaTags (tags that come with MentaOnRuby) and CustomTags (tags that you can code yourself).

The first MentaTag:

Let's create our own tag now. Place the following code inside the file HelloMerb/app/controllers/my_tag.rb:

In your application manager, just define your new tag like that:

Now in the HelloMerb/app/views/sayHello.html.erb you can use your tag like a regular Ruby method.

Mentawai will turn tags into instance methods of the controller, so you are free to call them in your pages.

You can download the new version from the Mentawai site: http://www.mentaframework.org/ruby/MentaOnRuby-0.4b.zip

Feel free to share your comments! There is much work to be done yet, but we are moving forward!

 
Forum Index » About Everything (English)
Go to:   
Powered by JForum 2.1.8 © JForum Team