All Questions

382
votes
18answers
149708 views

Rails 4: how to use $(document).ready() with turbo-links

I ran into an issue in my Rails 4 app while trying to organize JS files "the rails way". They were previously scattered across different views. I organized them into separate files and compile them wi...
244
votes
4answers
131414 views

How is attr_accessible used in Rails 4?

attr_accessible seems to no longer work within my model. What is the way to allow mass assignment in Rails 4?
547
votes
6answers
187903 views

How to use concerns in Rails 4

The default Rails 4 project generator now creates the directory "concerns" under controllers and models. I have found some explanations about how to use routing concerns, but nothing about controllers...
78
votes
6answers
54944 views

Rails 4 multiple image or file upload using carrierwave

How can I upload multiple images from a file selection window using Rails 4 and CarrierWave? I have a post_controller and post_attachments model. How can I do this? Can someone provide an example? Is...
210
votes
4answers
116413 views

Auto-loading lib files in Rails 4

I use the following line in an initializer to autoload code in my /lib directory during development: config/initializers/custom.rb: RELOAD_LIBS = Dir[Rails.root + 'lib/**/*.rb'] if Rails.env.devel...
78
votes
4answers
27969 views

JQuery gets loaded only on page refresh in Rails 4 application

I have created a Rails 4 application and have added fancybox library for an image popup effect. It works fine but only when the page is being refreshed. If the page is not refreshed by the user then t...
44
votes
3answers
26875 views

Rails 4 turbo-link prevents jQuery scripts from working

I'm building a Rails 4 app and I have a few scattered js files that I'm trying to include "the rails way". I moved jquery plugins into the /vendor/assets/javascripts and I updated the manifest (applic...
108
votes
6answers
118122 views

Rails 4 Nested Attributes Unpermitted Parameters

I am new to RoR but have decided I may as well learn on 4. This may or may not be a good idea. I am trying to create a form using nested attributes and I am struggling. I've looked at this railsc...
108
votes
3answers
73615 views

Rails 4 - Strong Parameters - Nested Objects

I've got a pretty simple question. But haven't found a solution so far. So here's the JSON string I send to the server: { "name" : "abc", "groundtruth" : { "type" : "Point", "coordinates...
178
votes
16answers
126709 views

How to reference images in CSS within Rails 4

There's a strange issue with Rails 4 on Heroku. When images are compiled they have hashes added to them, yet the reference to those files from within CSS don't have the proper name adjusted. Here's ...

Previous Next