0

I am a beginner in Ruby on Rails and I want to develop an app with many bells and whistles using Javascript (and jQuery UI).

The bells and whistles like drag and drop, instantly highlighting things when things are selected and movable portlets are important. This can lead me to creating most of the site in Javascript, which I have read is not the best thing.

My question is, what guide do I use so that I know when to use Server-side code (RoR) and when to use Javascript (other than for things that can't be helped).

I could make sure that Javascript is always enabled (or the app won't work), but is that a good idea?

Any help would be greatly appreciated.

2 Answers 2

1

The asset pipeline guide will teach you how to include your static assets in your code. As far as when to use javascript vs server side code, you should also look at these posts on unobtrusive javascript.

http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-technique/

http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/

If you follow that paradigm you'll find a good separation between what's done in the server and what's done on the client, where all of the data is generated server side and javascript is used for interactivity.

Sign up to request clarification or add additional context in comments.

2 Comments

I just read the articles and things are a lot clearer. It's much simpler to think of JS as the "skin" (forgive the generality of the word) over the html, which should work effectively (even though not "beautifully") without JS. Thanks again for your help.
Glad it helped and yes, that's the idea!
1

I recommend you to start with reading asset pipeline guide

1 Comment

This definitely helps for including the JS stuff. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.