lexer
2010-Aug-17 05:07 UTC
How to use local javascript library for development and externally hosted for production?
Hi guys, I want to set up my RoR project to use local javascript library for development and externally hosted for production (for example jquery from google). How it could be achieved? Regards, Alexey Zakharov -- 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.
Peter De Berdt
2010-Aug-17 09:05 UTC
Re: How to use local javascript library for development and externally hosted for production?
On 17 Aug 2010, at 07:07, lexer wrote:> I want to set up my RoR project to use local javascript library for > development and externally hosted for production (for example jquery > from google). How it could be achieved?<% if RAILS_ENV="production"> javascript_include_tag "http://somewhere.com/javascript_file_without_js " <% else %> javascript_include_tag "javascript_file_without_js" <% end %> http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M002225 Best regards Peter De Berdt -- 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.
Peter De Berdt
2010-Aug-17 09:07 UTC
Re: How to use local javascript library for development and externally hosted for production?
On 17 Aug 2010, at 11:05, Peter De Berdt wrote:> <% if RAILS_ENV="production">Typo: <% if RAILS_ENV=="production"> -- 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.
Chris Mear
2010-Aug-17 09:10 UTC
Re: How to use local javascript library for development and externally hosted for production?
On 17 August 2010 10:07, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > On 17 Aug 2010, at 11:05, Peter De Berdt wrote: > >> <% if RAILS_ENV="production"> > > Typo: <% if RAILS_ENV=="production">As an aside, the RAILS_ENV constant is now deprecated; the new way to do this test is: if Rails.env.production? Chris -- 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.
Tim Shaffer
2010-Aug-17 13:38 UTC
Re: How to use local javascript library for development and externally hosted for production?
Another option is to create your own configuration file and use the URL to the JavaScript file as a configuration variable. See here: http://railscasts.com/episodes/85-yaml-configuration-file -- 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.
lexer
2010-Aug-18 02:49 UTC
Re: How to use local javascript library for development and externally hosted for production?
Thanks guys. That was really helpful! -- 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.