Newbie Question

Q1. It looks that most convenient way of developing Rails Views is using form helpers when developing forms and partials.

On the other hand one can develop much richer HTML5 pages/mockups using WYSIWYG tools like CKEditor, Dojo/IBM Maqetta, etc.

How one can continue with Rails having already developed Web site mockups?

Q2. Up to my findings, Ajax can be automatically fired using :remote=>true but just in link_to and form_for helpers.

There are many other JavaScript client events when one needs Ajax to be called. How to proceed with Ajax in that case, for example onClick mouse/keyboard event?

A1. If you have a mockup already you replicate most of the look and feel by pasting that in your erb file and replacing forms etc with their form helper counterparts. The only issue to keep in mind, most of those produce less than optimal code, which means you may want to clean that up a bit.

A2. Rails comes with jQuery included by default (in later versions anyways). You can simply bind events to the DOM with jQuery. Something along the lines of:

$('#someId).on(‘click’,function(){

yourfunction();

});

It’s really quite easy once you learn how. Events | jQuery API Documentation