Erwin
2012-Apr-22 12:35 UTC
how to insert a javascript block in my haml %head , containing erb
X-posted with Haml group, as I don''t know which group it should be
posted ...
I am trying to insert this block ( which is inning fine in an
application.html.erb
<head>
<script type="text/javascript">
$(function() {
<%= yield :document_ready %>
});
</script>
</head>
I tried :
%head
:javascript
= yield :document_ready
%head
:javascript
''<%= yield :document_ready %>''
but no way , the yield :document_ready is never executed
feedback welcome
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Aziz Bookwala
2012-Apr-22 13:12 UTC
Re: how to insert a javascript block in my haml %head , containing erb
Hi Erwin
This should work:
%head
= yield :document_ready
On Sun, Apr 22, 2012 at 6:05 PM, Erwin
<yves_dufour-ee4meeAH724@public.gmane.org> wrote:
> X-posted with Haml group, as I don''t know which group it should be
> posted ...
>
> I am trying to insert this block ( which is inning fine in an
> application.html.erb
>
> <head>
> <script type="text/javascript">
> $(function() {
> <%= yield :document_ready %>
> });
> </script>
> </head>
>
> I tried :
>
> %head
> :javascript
> = yield :document_ready
>
>
> %head
> :javascript
> ''<%= yield :document_ready %>''
>
> but no way , the yield :document_ready is never executed
>
> feedback welcome
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
- Aziz M. Bookwala
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.