Rails data confirm with vue.js - ruby-on-rails

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.

Related

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 to use soundmanager2 wilth rails?

I have installed soundmanager2 within my rails application as a plug in.
after installation, I tried following command to use sound manager
rails generate sound_manager2
it shows generator not found error :(
Experimenting with rails 3 but actually wants to use with rails 2 and ruby 1.8.6
Anybody know, how it works under rails ? or is there any other way to play sound with rails app ?
Manually add the following SoundManager2 files to vendor/assets/javascripts/soundmanager2:
soundmanager2-nodebug-jsmin.js (or one of the other scripts, depending on your needs)
soundmanager2.swf
soundmanager2_debug.swf
soundmanager2_flash9.swf
soundmanager2_flash9_debug.swf
And then you should have either //= require tree . or //= require soundmanager2/soundmanager2-nodebug-jsmin in your application's JavaScript manifest file (app/assets/javascripts/application.js).
Or alternatively, just use the soundmanager-rails gem. I haven't used it myself, so I can't vouch for whether it works.
You can just drop the JavaScript and / or Flash files from the soundmanager2 download into your rails app, the plugin is just a JavaScript wrapper, you don't need it at all.
Then follow the offical Getting started guide

Adding animation to Ruby on Rails site.

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.

Which JavaScript framework would be better to be used for Rails?

I have been using jQuery for all my projects in PHP, Java etc. but now since I am starting up with Rails, I am bit confused about whether to stick with jQuery or use Prototype. Since Rails by default supports Prototype, is there any added advantage in using Prototype? Would it be fine if I use jQuery? Which JavaScript framework do you guys normally use?
jQuery will now be the default javascript framework in new version of rails. jQuery is best without any doubt.
Prototype came first but jQuery won the JavaScript framework wars. Rails 3 ships with jQuery by default, not Prototype. Use jQuery—it's pretty much the industry standard now.
Rails 3 is framework agnostic, just use whatever you prefer. I use Jquery.

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