I''ve been googling for ages, please help. I don''t want to use rjs and the view helpers for prototype, I just want to render javascript (jquery), and no I don''t want to use jrails either as this just partially mimics those same helpers. Can''t I just render a some_action.js file? Rails 2.0.2 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Can''t I just render a some_action.js file?Not entirely sure if that''s what you mean (it''s way past my bedtime :), but I use a JavascriptsController. This way, a request to ''/javascripts/some_action.js'' will be either satisfied by serving a static file from public/javascripts, or if no such file exists, by a controller method of that name from my JavaScriptsController, which renders a nice dynamic show_action.js.erb view. Hope this helps, Jan -- 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''m well rested now, but I am still not sure what you''re trying to achieve. You are not bound to use any helpers at all; you are free to write JS directly into your views the usual way if that is what you prefer. If you want to include an external script into a view, just put it into the public/javascripts folder of your application and include it either manually or through the javascript_include_tag helper. The JavascriptsController only makes sense if you have the need to create JS dynamically, say, with ERb. I''d be happy to provide examples, I just need to know which direction you''re heading here. Cheers, Jan -- 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 -~----------~----~----~----~------~----~------~--~---
Yes, I want to create raw (at least not using helpers) dynamically, so I could use e.g. jquery. On Apr 23, 11:24 am, Jan Foeh <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m well rested now, but I am still not sure what you''re trying to > achieve. You are not bound to use any helpers at all; you are free to > write JS directly into your views the usual way if that is what you > prefer. > > If you want to include an external script into a view, just put it into > the public/javascripts folder of your application and include it either > manually or through the javascript_include_tag helper. > > The JavascriptsController only makes sense if you have the need to > create JS dynamically, say, with ERb. > > I''d be happy to provide examples, I just need to know which direction > you''re heading here. > > Cheers, > Jan > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---