Adding animation to Ruby on Rails site. - ruby-on-rails

If I use JQuery to add animation to my Ruby on Rails web application, how is JQuery recognized by Rails? Is it just a matter of adding a Jquery gem? Or are some configuration instruction set in the code?
I'm still learning Ruby on Rails. And I would like to add custom animation to my home page but am not sure what tools/technology plays well with Ruby on Rails. JQuery, javascript, Ajax? Does anyone have any data regarding what percent of Rails application use which?

if you are using Rails 3+ JQuery should be included by default.

Related

Rails data confirm with vue.js

I am trying to do away with jQuery in my Rails 5.1 app and move to use only Vue.js.
I have three questions in this regard:
Is this a sensible thing to do? Can Vue.js fully replace jQuery or should they co-exist?
How would I replace all the data-confirm niceties that Rails provides by default and convert them to their Vue equivalent?
How would I localize strings such as the data-confirm strings?
Just trying to get an idea of whether this is feasible.
Thanks!
It looks like the Rails team removed the jQuery dependency from Rails 5.1, and jquery-ujs can be replaced with rails-ujs.
rails-ujs is written in plain JavaScript, so you can continue making a Rails + Vue.js app without jQuery.

View component in Rails

Is there any gem available for implementing view components in Rails? I had look at 'cells' and 'apotomo'. I found them good but documentation is not updated for the latest versions. Any one knows about any other good gem for implementing widgets kind of structures in rails?
You can use React js for view level components , use react-rails to integrate it with rails
If you are concerned with performance, you should try solutions like Angular.js , Backbone.js, React.js, Ember.js or any front end MVC framework.
Your code can be organized and run faster than use Apomoto or Rails partials, for example.

How does Bootstrap work with Ruby on Rails?

I'm unfamiliar with how Bootstrap is implemented on a web app built on Ruby on Rails. I've been asked to create the front-end ,HTML/CSS for new pages. I strictly have been working with small, static sites so I don't know the way to go about this. I've seen that the CSS files only include the specific code that your page requires?
Does that mean that I will have to copy each component's Boostrap CSS to a separate CSS file for my page?
You can choose one of the following gems to get all the required components of bootstrap in your rails application:
Twitter Bootstrap Rails
Less Rails Bootstrap
Furthermore detailed info to implement it on pages can be get # http://www.gotealeaf.com/blog/integrating-rails-and-bootstrap-part-1

How do I turn a RoR view to Responsive (html5)

I have a normal view in html in Rails, containing images and links. How do I turn it to be responsive? (I want it to fit also mobile browser sizes, make it html5)
I know I should use fluid, but what is the full command? Or is there another/better way directly from the text editor?
Rails has limited control on the HTML that comes on to the browse.
Try looking at frameworks like Bootstrap or Foundation.
There are some gems that can help you
Foundation-rails
twitter-bootstrap-rails
There is also a railscast episode on Bootstrap basics.
This has nothing much to do with Rails. Rails is a server side language and responsive templates are frontend (html/css) dependent.
However if you are specifically using bootstrap as many beginners do, you could try : https://github.com/seyhunak/twitter-bootstrap-rails gem for a quick integration of things.

Mootools + Ruby on Rails ==?

I just wonder if there is any chance to integrate Mootools into Ruby on Rails with working helpers like remote_function() or page.replace() ?
If you really want to use helpers, I would take a look at
http://code.google.com/p/mootools-rails-helper/
I'm using jQuery in my Rails project without helpers and that works pretty well, too.

Resources