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
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
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 %>
Best regards
Peter De Berdt
On 17 Aug 2010, at 11:05, Peter De Berdt wrote:
<% if RAILS_ENV=“production”>
Typo: <% if RAILS_ENV==“production”>
Another option is to create your own configuration file and use the
URL to the JavaScript file as a configuration variable.
See here: #85 YAML Configuration File - RailsCasts
Thanks guys. That was really helpful!
On 17 August 2010 10:07, Peter De Berdt [email protected]
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs