If you’ve recently loaded a new Rails 4 application to Heroku and your assets are missing (css, js, etc) – you’re not alone. Add the following lines to your production.rb (or staging.rb) environment configuration files: config.serve_static_assets = true config.assets.compile = true Then push the changes up to Heroku and you’re good to go.
Read More
Rails 3.x / 4.0 does not handle remote multipart forms natively, so a workaround is needed. To get remote multipart forms working correctly you can use the following steps (quick solution). First: Add the remotipart gem to your GemFile gem 'remotipart', '~> 1.2.1' Then, Update your javascript manifest file (in basic configurations this is usually found in assets/javascript/application.js). Include the following requirement: //= require jquery.remotipart In my case, I’m binding [...]
Read More
If you’re using Bootstrap 3.x to generate a remote link based modal, you’ll notice that re-clicking the same link does not re-request the content of the remote URL and instead just re-displays the same content from the previous load. This isn’t a great result in many cases (forms for new objects for instance). To resolve this issue do the following: $(document).ready(function(){ $('body').on('hidden.bs.modal', '.modal', function () { $(this).removeData('bs.modal'); }); }); This [...]
Read More