Top "Ruby-on-rails-4" questions

For issues specific to version 4 of Rails.

Rails 4.0 Strong Parameters nested attributes with a key that points to a hash

I was playing around with Rails 4.x beta and trying to get nested attributes working with carrierwave. Not sure if …

ruby-on-rails ruby ruby-on-rails-4 strong-parameters
Merge arrays in Ruby/Rails

How can I merge two arrays? Something like this: @movie = Movie.first() @options = Movie.order("RANDOM()").first(3).merge(@movie) But …

ruby-on-rails ruby ruby-on-rails-4 orm rails-activerecord
couldn't find file 'jquery' with type 'application/javascript'

This might seem a repeated question but none of the solutions seem to work for me. I have gem jquery-rails …

jquery ruby-on-rails ruby-on-rails-4 assets
Heroku does NOT compile files under assets pipelines in Rails 4

Everything goes well in local machine with assets pipeline in Rails 4 and Ruby 2.0. But when deploying to heroku, it is …

heroku asset-pipeline ruby-on-rails-4
Rails API : Best way to implement authentication?

I'm writing a Rails 4 app that will expose an API for a mobile app that's yet to be developed. Users …

ruby-on-rails ruby-on-rails-4 rails-api
rails confirm before delete

Here is my rails link_to <%= link_to 'Delete',url_for(action: :delete,id: @user.id),data: {confirm: "Are …

ruby-on-rails ruby-on-rails-3.2 ruby-on-rails-4
Rails 4 [Best practices] Nested resources and shallow: true

The following post is based on Rails 4. I am currently looking for a best-practice about the multiple nested resources (more …

ruby-on-rails api rest ruby-on-rails-4 nested-routes
Redirect to log in page if user is not authenticated with Devise

I'm using Devise with Ruby on Rails. What is the recommended way to redirect unauthenticated users to the sessions#new …

ruby-on-rails ruby-on-rails-4 devise warden
ActiveRecord query through multiple joins

I have a schema like this. managers has_many :emails has_many :stores emails belongs_to :manager stores belongs_to :…

ruby-on-rails-4 rails-activerecord active-record-query
How to override X-Frame-Options for a controller or action in Rails 4

Rails 4 appears to set a default value of SAMEORIGIN for the X-Frame-Options HTTP response header. This is great for security, …

ruby-on-rails iframe http-headers ruby-on-rails-4 x-frame-options