Peter Michaux
2006-Nov-25 18:38 UTC
adding a different template (.fjs) and connecting with respond_to
Hi, I am writing a new JavaScript templating system for Rails as a plugin. I want to use the extension ".fjs". When a user "wants.js" in a respond_to block I would first like to look for a .fjs file and render it with my new templating system. If an .fjs file is not present then look for .rjs file and render with the rjs templating system. Is this easily possible through the Rails API or is this going to be hacking the Rails core? Any pointers how to do this or get started would be greatly appreciated. Thank you, Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Scott Becker
2006-Nov-26 05:38 UTC
Re: adding a different template (.fjs) and connecting with respond_to
On 11/25/06, Peter Michaux <petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I am writing a new JavaScript templating system for Rails as a plugin. > I want to use the extension ".fjs". When a user "wants.js" in a > respond_to block I would first like to look for a .fjs file and render > it with my new templating system. If an .fjs file is not present then > look for .rjs file and render with the rjs templating system. > > Is this easily possible through the Rails API or is this going to be > hacking the Rails core? > > Any pointers how to do this or get started would be greatly appreciated. > > Thank you, > Peter > >Dan Webb created MinusMOR, which does this with the .ejs extension. I bet that would be a good place to start. http://www.danwebb.net/2006/11/24/minusmor-released http://svn.danwebb.net/external/rails/plugins/minus_mor/trunk/ -- Scott Becker Electro Interactive, Inc. Office: 813-333-5508 http://www.ElectroInteractive.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 -~----------~----~----~----~------~----~------~--~---
Peter Michaux
2006-Nov-26 06:35 UTC
Re: adding a different template (.fjs) and connecting with respond_to
Hi Scott, On 11/25/06, Scott Becker <becker.scott-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 11/25/06, Peter Michaux <petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > I am writing a new JavaScript templating system for Rails as a plugin. > > I want to use the extension ".fjs". When a user "wants.js" in a > > respond_to block I would first like to look for a .fjs file and render > > it with my new templating system. If an .fjs file is not present then > > look for .rjs file and render with the rjs templating system. > > Dan Webb created MinusMOR, which does this with the .ejs extension. I bet > that would be a good place to start. > > http://www.danwebb.net/2006/11/24/minusmor-released > http://svn.danwebb.net/external/rails/plugins/minus_mor/trunk/I wanted to write exactly what MinusMOR does (i just picked on letter away in the extension). Wrapping JavaScript in Ruby seems like a bad idea after using RJS for even a short time. I hope a bunch of Railers jump on the MInusMOR bandwagon. Great stuff! This was literally the next project on my list. I am happy it already has been done. :D Thanks for the link! :D Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---