Comments (6)
It probably should include instructions, but it's pretty easy. Just drop the rails.js and a copy of jquery in your public/javascripts
directory (after deleting all the prototype stuff if it exists), then edit your config/application.rb
to enable it, you'll be looking for a line like this..
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
Just uncomment that and change the filenames to match your javascript files (without the. .js).
An even easier way is to just install the jquery-rails
gem and run rails generate jquery:install
(or rails generate jquery:install --ui
if you also want jquery-ui). The gem downloads everything you need, puts it in public/javascripts and handles the configuration for you automagically.
from jquery-ujs.
Thanks! That DEFINITELY needs to be in the README :)
from jquery-ujs.
committed in 17e4a9f
from jquery-ujs.
awesome, thanks!!
from jquery-ujs.
With the jquery-rails gem installed, when I run
rails generate jquery:installI just get the rails new help info. Has this syntax changed in Rails 3? I tried using the rails new command as well, but that didn't work.
Obviously I can manually install, but just wanted to make use of the gem if possible.
from jquery-ujs.
Don't worry... just me being thick. I was running the command from the folder above the rails app folder. Works a treat now :-)
from jquery-ujs.
Related Issues (20)
- TypeError: Handler is undefined HOT 1
- Using jquery_ujs in a non-Rails application HOT 1
- Rails `remote: true` not making AJAX request HOT 1
- Incorrect //= require in application.js HOT 1
- Disable remote select when waiting for the response from the server
- link with data-remote=true fails inside disabled fieldset HOT 1
- Form rendered by js.erb does not submit by ajax HOT 1
- Modified data-params attribute doesn't get submitted HOT 3
- Why does my form always get submitted with Content-Type:application/x-www-form-urlencoded; HOT 4
- does rails enforce data-method "GET" be uppercase? HOT 1
- not works as expected with rails-5.2 HOT 1
- npm support HOT 2
- button_to my_routed_path(a: "ok", b: "or", c: "not?"), remote: true does NOT call JS rendering HOT 1
- event.preventDefault does not prevent default action
- $.rails undefined with jquery 3.4.0 HOT 10
- Future of this gem HOT 1
- XSS in some browsers
- File form redirection
- What do you mean that they are being included? It is fine if they are included in `Gem.loaded_specs`, the real issue is if they are being _required_.
- Ajax responses not working on js.erb requests in Rails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-ujs.