I guess it's going to depend on your project and how involved the business logic is. I can envisage in cases where you have a string of calculations to do (like add up the value of the order items, calc shipping and apply tax to display a total cost) it might not be very DRY to redo that in JS.
I can see 3 ways to deal with that: - Call the server to get the answer - Write the logic in JS to start with and run JS on the server - Compile Ruby into JS BTW: If you're still interested in the third option, this might interest you: https://github.com/jessesielaff/red On Fri, Feb 11, 2011 at 12:55 PM, Julio Cesar Ody <[email protected]> wrote: > Rather, from the original question, the problem as I see it is there's a > misunderstanding of what has to be done in order to solve the problem. > What the model does in the back-end doesn't have to be replicated in the > view. Possibly what you'll have is, say, deleting an instance in JS should > remove a row in a <table>. That's nothing the actual Ruby class should even > care about. > > And take a look at backbone.js. -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
