How to write JavaScript form validations in Rails? - ruby-on-rails-3

Please suggest any source of information(Screencast or Article) to read about Javascript form validation in Rails. I have searched railscasts.com for the screencasts related to this topic , however, I wasn't able to find any article specifically dedicated to this topic.
Thanks in advance.

I suggest you use jQuery as it makes it very easy, using this plugin: http://docs.jquery.com/Plugins/Validation.

Related

Alternate for template engines in express

I dove into express.j and encountered pug (template engine).Now, i don't like the idea of writing code that works very similar to HMTL+ some identation.I'd rather stick with normal HTML.I want to discard view engines altogether . Is there another way to hook these html,css and javascript files instead of pug.I read Angular is utilized. Could someone elaborately with a form examlple,styled with css and how to integrate Angular with express.js . Perhaps any tutorial available online...
P.S. Please refrain from using too much technical terminology..I'm a noob. Simple english is appreciated.
You can use 'handlebarsjs'.
That is a great tutorial to get start.
https://www.youtube.com/watch?v=1srD3Mdvf50
Good luck.

I don't understand the Dojo documentation

I'm a beginner in dojo. First of all is everything javascript based? For example to create a form I have to use JavaScript or HTML tags?
Also I cannot understand their documentation and tutorials. It's very confusing.
Is there a proper website (other then dojo itself) that has good tutorials?
You can use Dojo's components's (widgets) in two ways. Programmatic and declaritive. The programmatic way (what you are talking about) is by defining widgets through the use of javascript. With declaritive you can define them using HTML markup. David Walsh has a nice short writeup and if you search for "declaritive programmatic dojo" you'll find some questions and answers on the matter:
https://davidwalsh.name/dojo-widget
Difference between programmatically vs declaratively created widgets in dojo?
Declarative coding or programmatic coding in Dojo Projects?
Declarative or programatic approach in DOJO?
If you're having trouble with the tutorials on the Dojo website, i suspect you're better off, first diving into some basic beginner javascript tutorials before trying to learn a framework like Dojo. I concur with the comment Ferry made on your question, there are no better resources than the actual Dojo website. I recommend following every tutorial, starting with the Hello Dojo tutorial and working your way up so that you don't miss out on the basic concepts which you'll need when you read the harder tutorials. Good luck!
For your first question: dojo is javascript-based platform that provide you with a basic javascript library and a bunch of basic widgets (UI controls like button, dialogue, layouts,...), and some extra things. However, you don't really have to use dojo all the time: you still can use dojo to manipulate a html form button; it's just dojo button comes with extra functionalities and might save you some time.
For the second question, I agree with iH8 that dojo website is the best place to start. There are three different ways dojo websites can help you:
Look at the tutorial: Basic steps on how to set it up and use provided functionalities as-is
Look at thetoolkit api: This provides a very detailed view of dojo javascript object (See what extra things you can do with dojo objects)
Look at the nightlytest: I found this very helpful in term of showing me what can be done outside of the tutorial (i.e. how to use things you found in the api)
Other than these, you can look at existing implementation to learn about the toolkit.
Basically, this is how I am learning Dojo. Without more-specific questions, it's hard to tell what is confusing about the tutorial. I would recommend you give it a try and post a question: everyone here will be willing to help you.
I recommend starting with some video tutorial like this.
When you understand the concept, you can try to copy and paste some code from Dojo documentation tutorials or Reference Guide, because all books are out-of-date.
Also you may find some useful information on IBM-related sites like http://www.ibm.com/developerworks because IBM invested in Dojo and uses it for its products.
If you have enough resources ($) you can take participation in Workshops (sitepen.com/workshops)

Automatic website creation using rails

I am looking for a template generator for rails, much like the scaffolding, but complete with preset pages and css, everything already built-in generically.
I am unsure where or how to search for this.
The reason I want something like that and not create one myself, is that I need to create a website really quickly with a certain preset theme
I had the same problem that you had, and could not find a solution. Therefore I built a gem for it.
https://github.com/bighostkim/simple-layout
It only applies to your development mode and it does not use asset to make it simple.
Hope it helps.
Rails Yard may be the solution you are looking for. It is a CMS written in Rails.
Rails CMS WIKI FORUM 2nd option
Rails Admin is great for data management (Create, Retrieve, Update, Delete).

Is there a web UI for modifying I18n locales for Rails 3?

I'm looking for a way to modify the values of I18n yml files for locales via web gui, is there some gem for that?
A gem that mimics Twitter Translation Center github.com/badrit/translation_center
Tolk is a web interface for doing i18n translations packaged as an engine for Rails 4 applications
https://github.com/tolk/tolk
Yes, I modified the Newsdesk's translate plugin for using with Rails 3:
https://github.com/romanbsd/translate
There's also tolk written by the creator of rails:
https://github.com/dhh/tolk
In http://rst-it.com we also had problems with finding the right solution, so we decided to make an activeadmin translation panel with interface similar to http://www.localeapp.com/.
Currently we are in design stage (first draft is on https://github.com/KMPgroup/active_I18n) but next week we will have working solution.
I will post here info when we lunch it, but in the meantime you can check https://github.com/KMPgroup/active_I18n and tell us what you think or even write an issue - the more feedback at the beginning the better.
This looks promising too:
http://www.localeapp.com/
I think I will give it a try. Anyone has experience with this service?

A tooltip widget/plugin in YUI3

I am writing an app and I want stack overflow like tool-tips updated with ajax. And I want it in AJAX too.
Please tell me if any such library already exists and otherwise will it be helpful to write a one from scratch.
I found two solutions
The YUI3 Alloy Tooltip module. Which is poorly written and not suitable for my use.
The example provided by YUI3 http://developer.yahoo.com/yui/3/examples/widget/widget-tooltip.html
It is helpful and customizable.