rubyonrailsin

A Ruby and Rails talk

Saturday, March 20, 2010


[spree-user] Extension Hooks inside_head, and Rails standard helpers

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Hi,

I've created an extension and would like to add some CSS and Scripts
to the header of my spree application...

So I'm trying to use extension hooks like this (my extension is called
restfulx) :

================================================================================================
in ./vendor/extensions/restfulx/restfulx_hooks.rb

insert_after :inside_head do
stylesheet_link_tag 'history/history.css'
javascript_include_tag [ 'AC_OETags.js', 'history.js' ]

<<-FLASH_VERSION
<script language="JavaScript" type="text/javascript">
<!--
//
-----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = ${version_major};
// Minor version of Flash required
var requiredMinorVersion = ${version_minor};
// Minor version of Flash required
var requiredRevision = ${version_revision};
//
-----------------------------------------------------------------------------
// -->
</script>
FLASH_VERSION
end
================================================================================================

But standard Rails helper seems not to be accessible in this context
(stylesheet_link_tag, javascript_include_tag...)...

How can I get them accessible?
Is the right way to do this?


Bruno.


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

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive