Frederick Cheung wrote:
> On Jan 15, 3:50 pm, Alpha Blue <[email protected]> wrote:
>> Fred, so the issue with the code above is this:
>>
>> When using such a helper it will display:
>>
>> link href="/stylesheets/public/themes/default/stylesheets/default.css"
>> media="screen" rel="stylesheet" type="text/css"
> 
> That sounds like the path you passed didn't have a leading / (and you
> don't want the public in there).
> 
> Fred

Fred, as always, you were correct.  I removed the monkey patching code 
and then I fixed the test helper to:

def current_theme_path(type)
  path = "/themes/" + @opt_default_theme + "/images/" if type == 'img'
  path = "/themes/" + @opt_default_theme + "/stylesheets/" if type == 
'css'
  path = "/themes/" + @opt_default_theme + "/javascripts/" if type == 
'js'
  path = "/themes/" + @opt_default_theme + "/swfs/" if type == 'swf'
  return path
end

...

And finally in my layout:

<%= stylesheet_link_tag(current_theme_path('css')+ @opt_theme +'.css') 
%>
<%= javascript_include_tag(current_theme_path('js')+ @opt_theme +'.js') 
%>

.. and it works.

I'll work with this bit of code instead and see how it affects asset 
caching.

-- 
Posted via http://www.ruby-forum.com/.
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to