I am considering going the route of javascript templates for my app, and
trying to determine the negatives to doing this. The primary reasons I am
looking at this:

1) Rails 3 + coffeescript is amazing and I see going in a more object
oriented direction with js now. That lends to passing data to my app via
json objects, at least in the case I am currently looking at.

2) I have started using Jasmine + jasmine-jquery which allows fixtures. In
desire to remain DRY and as minimalist as possible, using js templates looks
promising as in essence my 'view' will be contained in the js itself and
easily passable to jasmine-jquery for testing, which goes pretty far from
removing the need for me to run long selenium tests. Once I want to test any
rendered views, this method falls apart unless I can render them and attach
to the Jasmine spec. Pivotal does have a solution to this but to me this is
more of a work-around than a close to the road approach (
http://pivotallabs.com/users/jb/blog/articles/1152-javascripttests-bind-reality-
).

However, it seems the cost (other than a learning curve), is the loss of the
benefits that Rails view rendering provides, such as all the helpers, etc.
This is what is good about Pivotal's approach. Not excited at all to go back
to manually rendering and maintaining select boxes, for example. Is there a
way to keep some benefit of helpers but going this route, but perhaps in
another js library???

So... if anyone has experience or comments would love to hear. Any drawbacks
to going this route with Rails -- confirmation of what I write above or
other problems I have not thought of? Also, from what I see jQote2 is the
fastest out there.... anyone using?


Thanks!

David

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to