I want to thank everyone for the tremendous response to HAML. I'm
absolutely amazed at the sheer number of sites that have switched over
to HAML. I am honestly shocked at the emails I get. This started as a
passion of mine and has grown into the passion of others. Special
thanks for this release goes to Nathan Wiesenbaum who gives new meaning
to prolific.
---THE DEAL---
After nearly a 90% code-base rewrite, we find our selves with a
new-and-improved HAML... codenamed The Bomb. And its features are ready
to *drop*!
We have many, many new features available including...
- Multi-class Handling
- Multi-single-lines with the - character.
- Blocks via Silent Scripting
- Proper Error Reporting
Read all about the new features at:
http://hamptoncatlin.com/2006/haml-0-2-the-bomb
Or, just update your code off the haml trunk:
svn://hamptoncatlin.com/haml/trunk
The README file is far more complete now and is almost a tutorial. So,
give that a read-through to find new features.
-hampton.
How does HAML handle if-else-then constructs? I use them to
selectively show menu options, for example.
<% if current_user.has_permission?('admin') %>
<%= link_to "admin menu", :controller => "admin", :action => "menu" %>
<% else %>
<%= link_to "normal menu", :controller => "welcome", :action => "menu" %>
<% end %>
-Larry
--
Best Regards,
-Larry
"Work, work, work...there is no satisfactory alternative."
--- E.Taft Benson
- if current_user.has_permission?('admin')
= link_to "admin menu", :controller => "admin", :action => "menu"
- else
= link_to "normal menu", :controller => "welcome", :action => "menu"
But, my personal style-preference is doing this with menus.
File: _admin.haml
.admin.menu
= link_to "admin menu", :controller => "admin", :action => "menu"
File: _guest.haml
.guest.menu
= link_to "normal menu", :controller => "welcome", :action => "menu"
Then, do....
= render :partial => (current_user.has_permission?('admin') ? 'admin' :
'guest')
Keeps it a little more D.R.Y. ... and obviously you usually have more
than a link-difference in a menu.
Though, that's a personal style-choice.
-hampton.
Then, back in your o
On Oct 18, 12:15 pm, "Larry Kelly" <ldk2...@gmail.com> wrote:
> Exciting! I read the tantalizing apetizers on your blog and trac
> site. Can't wait for the main course to be served. Will the trac
> tutorial be expanded soon?
>
> How does HAML handle if-else-then constructs? I use them to
> selectively show menu options, for example.
>
> <% if current_user.has_permission?('admin') %>
> <%= link_to "admin menu", :controller => "admin", :action => "menu" %>
> <% else %>
> <%= link_to "normal menu", :controller => "welcome", :action => "menu" %>
> <% end %>
> -Larry
>
Also, what is the best way to contact you about HAML, is there a
mailing list, or is posting to the RubyRails list the best place?
Thanks for your help.
-Larry
On 10/18/06, hca...@gmail.com <hca...@gmail.com> wrote:
>
--
What kind of select tag do you mean? There are rails helpers for the
basic kinds, unless you have some specific need.
-hampton.
Is there a tutorial, and/or a reference for the HAML DSL someplace. I
didn't see anything an the plugin.
-Larry
%table
%tr
%td= label_for :model, :attribute
%td= select :model, :attribute, @droplist
That'd be the Haml for that.
-hampton.