Questions tagged [ruby-on-rails-3.2]

Ruby on Rails version 3.2.0 released at January 20, 2012. Use this tag for issues related to development in Ruby on Rails version 3.2.0.

Ruby on Rails version 3.2.0 is a specific version of Ruby on Rails. Released on January 20th, 2012. It has been succeeded by version 3.2.15. It brings many improvements to the Ruby on Rails web development framework.

The distinct features include:

  • Faster development mode: only modified classes are reloaded giving a visible performance boost.
  • Automatic Query Explanation: database queries taking longer than 30 seconds to execute are automatically explained while in development mode.

Further reading:

Related tag

6982 questions
43
votes
2 answers

What should I render when destroying a record?

I have an API that lets you destroy an object. The part I'm not sure on is what JSON should be rendered after the record has been destroyed. Here are a couple options, but I'm not sure what the best practice is for this. Version 1: Return empty…
Peter Brown
  • 50,956
  • 18
  • 113
  • 146
43
votes
4 answers

How to require a ruby file from another directory

I am trying to require a rake file that I have created inside another file I have. These two files are inside two different directories. I have require at the top of my first file with the name of the second file inside the quotes after the require.…
43
votes
4 answers

Using question mark character in Rails/ActiveRecord column name

In keeping with Ruby's idiom of using a question mark in boolean methods (e.g. person.is_smart?), I'd like to do the same for an ActiveRecord field in Rails: rails generate model Person is_smart?:boolean I haven't actually run the above statement.…
at.
  • 50,922
  • 104
  • 292
  • 461
42
votes
3 answers

Gem Vs Plugin Vs Engine in Ruby on Rails

What is the difference between Gem package, plugin, and Engine in Ruby on Rails? I think we use the plugin before Rails3.2 and after rails3.2 is released we are using the gem package as a plugin but how can we use the engine in ROR?
42
votes
13 answers

TinyMCE 4 links plugin modal in not editable

I am using tinyMCE4 editor inside a Boostrap modal dialog. when I clicked on link icon it opens a new modal dialog box, It displayed fine but the input areas are not editable.
42
votes
6 answers

How to get ActiveAdmin to work with Strong Parameters?

Update: this question was asked before there was a solution for it already in ActiveAdmin. As Joseph states, the ActiveAdmin documentation now contains this information, but the answers here are provided for those working with older versions of…
42
votes
1 answer

Rails: Too Few Arguments

I am trying to get some Javascript working in my Rails app. I want to have my index page allow me to edit individual items on the index page, and then reload the index page upon edit. My index.html.erb page looks like:
<%= render…
Noah Clark
  • 8,101
  • 14
  • 74
  • 116
41
votes
6 answers

rake assets:precompile attempting to connect to database

I'm attempting to debug why my application is attempting to connect to my database when I run rake assets:precompile --trace. I'm probably missing something in the stack trace...anyone see the pertinent line? DEPRECATION WARNING: The…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
41
votes
1 answer

ArgumentError (too few arguments): when calling format.json on rails 4.04

When executing format.json{render json: {}, status: :ok} in Rails 4.0.4, I get the following error: ArgumentError (too few arguments): Although I have another program (with Rails 3.2.13) where the exact same line executes with no problem. am I…
juan Isaza
  • 3,646
  • 3
  • 31
  • 37
41
votes
3 answers

The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called 'Layouts and Rendering in Rails', does not work for me:

The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called 'Layouts and Rendering in Rails' at http://guides.rubyonrails.org/layouts_and_rendering.html, does not work for me That's the sample code provided in the…
Caroline Schnapp
  • 798
  • 1
  • 7
  • 14
40
votes
5 answers

Uploading a remote file url from Rails Console with Carrierwave

I just wanted to know how one would go about uploading a remote file url using Carrierwave in the Rails console. I tried the following without any luck. I presume it's not processing the Uploader? user = User.first user.remote_avatar_url =…
Wasabi Developer
  • 3,523
  • 6
  • 36
  • 60
40
votes
4 answers

Rails 3.2, RSpec, Factory Girl : NameError: uninitialized constant Factory

Ive been following this introductory to Rails testing and Ive run into an issue I cant seem to find the solution to. Im very familiar with Rails but this is my first foray into testing. Anyhow, I have a very basic model test, not even fully…
39
votes
4 answers

Textarea resizes and triggers best_in_place blur event

I'm using the best_in_place gem on several textareas and sometimes (seemingly randomly) the textarea 'jumps' and triggers the blur event when I click save, prompting the "discard your changes" warning. Here's the code:

Administrator Notes (<%=…

Simon
  • 1,716
  • 1
  • 21
  • 37
39
votes
2 answers

Rails joins through association

In Ruby on Rails, I want to find employers in the city. Lets say the models are set up this way: City has_many :suburbs has_many :households, :through => suburbs has_many :people, :through => suburbs Suburb has_many :households has_many people,…
spitfire109
  • 9,651
  • 3
  • 20
  • 28
39
votes
2 answers

Rails route to only index

This might be a simple routing question in Rails but I have searched around and received answers for Rails 2 rather than Rails 3. I generated a scaffold and the resources :users which includes new, edit, show are routed together with the index. I…
Butter Beer
  • 1,100
  • 3
  • 16
  • 32