Anyone know an elegant way to customize the default javascript includes for rails? I don''t use prototype at all -- I use Ext. I wanna'' make my Ext libs + custom application libs the default. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, you can define the following in your environment.rb JAVASCRIPT_DEFAULT_SOURCES = [ ''prototype'', ''my_js_file1'', ''my_js_file2'', ... ] For further information, you can check the following site: http://caboo.se/doc/classes/ActionView/Helpers/AssetTagHelper.html Good luck, -Conrad On Jan 18, 2008 7:14 PM, Chris Scott <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Anyone know an elegant way to customize the default javascript includes > for rails? > > I don''t use prototype at all -- I use Ext. I wanna'' make my Ext libs + > custom application libs the default. > -- > 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 -~----------~----~----~----~------~----~------~--~---
cheers, mate. that''s what I was looking for. -- 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 -~----------~----~----~----~------~----~------~--~---
actually, that doesn''t work. # environment.rb JAVASCRIPT_DEFAULT_SOURCES = [''foo'', ''bar''] # nor does this ActionView::Helpers::AssetTagHelper.const_set(:JAVASCRIPT_DEFAULT_SOURCES, [''foo'', ''bar'']) damn. I can''t believe it''s this difficult to change the default js includes. -- 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 -~----------~----~----~----~------~----~------~--~---
I created a ticket a while back to allow you to easily add to :defaults, or create your own symbols that expand to multiple sources. If this looks like something that would be useful to you, check it out and add a +1 to the ticket. http://dev.rubyonrails.org/ticket/10350 On Jan 19, 2008 12:27 PM, Chris Scott <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > actually, that doesn''t work. > > # environment.rb > JAVASCRIPT_DEFAULT_SOURCES = [''foo'', ''bar''] > > # nor does this > ActionView::Helpers::AssetTagHelper.const_set(:JAVASCRIPT_DEFAULT_SOURCES, > [''foo'', ''bar'']) > > damn. I can''t believe it''s this difficult to change the default js > includes. > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Mark Van Holstyn, Partner / Software Developer mvanholstyn-y/MygF1AHQSJ0iEMtI82hwC/G2K4zDHf@public.gmane.org, (616) 706-6842 Mutually Human Software, http://mutuallyhuman.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 -~----------~----~----~----~------~----~------~--~---
> something that would be useful to you, check it out and add a +1 to the > ticket.done. as a quickie, I defined my own method for ActionView::Helpers::AssetTagHelper #set_javascript_defaults # environment.rb ActionView::Helpers::AssetTagHelper.set_javascript_defaults([''foo'', ''bar'']) however, now I want different resources based upon RAILS_ENV (ie: for production, I want to include minified resources. I use a custom js builder to build my resources). I expected I could simply place the above line into development.rb but I get an error: "config/environments/development.rb:24:in `load_environment'': undefined method `set_javascript_defaults'' for ActionView::Helpers::AssetTagHelper:Module (NoMethodError)" -- 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 -~----------~----~----~----~------~----~------~--~---