[haml] is writing an helper better ?

2011-02-20 Thread kadoudal
I read in some forum :  'HAML is for layout !'  and recommendation to
use helpers for any other purpose...

so if I write an helper to output specific Facebook tags :
"Give me access"

something like :
= fb_prompt_permission

in my view, and my helper being :

module PagesHelper
  def fb_prompt_permission
html = ""
return html
  end
end

it's good HAML design ?

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.



Re: [haml] is writing an helper better ?

2011-02-20 Thread Chris Eppstein
Helpers should be used to keep programming logic outside of your views. Haml
is for generating markup. You can do this using normal haml syntax:

%fb:prompt-permission(perms="offline_access") Give me access

chris


On Sun, Feb 20, 2011 at 8:56 AM, kadoudal  wrote:

> I read in some forum :  'HAML is for layout !'  and recommendation to
> use helpers for any other purpose...
>
> so if I write an helper to output specific Facebook tags :
> "Give me access fb:prompt-permission>"
>
> something like :
> = fb_prompt_permission
>
> in my view, and my helper being :
>
> module PagesHelper
>  def fb_prompt_permission
>html = "html << "Give me access"
>html << ""
>return html
>  end
> end
>
> it's good HAML design ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to haml@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.