Fernando Perez
2009-Jan-06 21:13 UTC
Change the default folder for image_tag, javascript_include_
Hi, I don''t want my default folder to be mysite.com/images/logo.png, but instead mysite.com/common/images/logo.png How can I change that? Same applies to stylesheets and javascripts. Thanks -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2009-Jan-06 23:52 UTC
Re: Change the default folder for image_tag, javascript_include_
> I don''t want my default folder to be mysite.com/images/logo.png, but > instead mysite.com/common/images/logo.png > > How can I change that? Same applies to stylesheets and javascripts.Don''t know if there''s an official way, but you could monkey patch some of the methods... Look at actionpack/lib/action_view/helpers/asset_tag_helper.rb... and override these methods: def compute_javascript_paths(*args) expand_javascript_sources(*args).collect { |source| compute_public_path(source, ''javascripts'', ''js'', false) } end def compute_stylesheet_paths(*args) expand_stylesheet_sources(*args).collect { |source| compute_public_path(source, ''stylesheets'', ''css'', false) } end def image_path(source) compute_public_path(source, ''images'') end -philip --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2009-Jan-07 10:41 UTC
Re: Change the default folder for image_tag, javascript_include_
> Don''t know if there''s an official way, but you could monkey patch some > of the methods... >Hi Phil, I know that we can set an assert server, and I think that one day I also bumped into changing the default folder (I might be wrong), but I cannot find that piece of information again, so I cannot confirm. I would rather not start monkey patching for such a simple problem, otherwise i can simply add the "absolute" path for the assets, but the line is getting long. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---