[katello-devel] Javascript View Includes

Ohad Levy ohadlevy at redhat.com
Mon Jul 11 14:23:49 UTC 2011


On Mon, 2011-07-11 at 07:58 -0600, Jason Rist wrote:
> On 07/11/2011 07:11 AM, Eric Helms wrote:
> > I have attempted to streamline javascript includes so that they are all
> > placed in the html head and not inline.  If you need to include
> > javascript in a view template, you can place the javascript calls inside
> > a "- content_for :javascripts do" block. For Example,
> > 
> > - content_for :javascripts do
> >   = include_javascripts :env_select
> > 
> >   :javascript
> >     var foo = "bar";
> > 
> > 
> > Eric Helms
> > ehelms at redhat.com
> > 
> > _______________________________________________
> > katello-devel mailing list
> > katello-devel at redhat.com
> > https://www.redhat.com/mailman/listinfo/katello-devel
> Erm... what does this do? Force it into the head of the rendered haml?

Yeah.

FYI, its easy to make helpers for this stuff, such as:
https://github.com/ohadlevy/foreman/blob/develop/app/helpers/layout_helper.rb

Ohad




More information about the katello-devel mailing list