Questions tagged [ruby-on-rails-3.1]

Ruby on Rails version 3.1.0 is a specific version of Ruby on Rails. It was released on August 30th, 2011. Use this tag for issues related to development in Ruby on Rails version 3.1.

Ruby on Rails version 3.1.0 is a specific version of Ruby on Rails.

Released on August 30th, 2011, it was succeeded by version 3.2.0.

It brings many improvements to the Ruby on Rails web development framework, which is open-source and optimized for programmer happiness and maintaining sustainable productivity. Many things are defined by convention, freeing you from having to re-invent things to stay productive.

Version 3.1 brings many improvements over its preceding version 2, including faster ActiveRecord, assets re-structure, coffeescript, sass, and more.

Further Reading:

Related tag

5270 questions
30
votes
4 answers

Set maximum length in Text field in RoR

Has anyone managed to set maximum field lenghts for text fields How can i set the maximum length of a text field. Here is the code iam using <%= text_field_tag(:create_text), :input_html => {:maxlength => 15, :size => 40} %> but I cannot seem to…
29
votes
7 answers

Error while loading shared libraries: 'libpcre.so.0: cannot open shared object file: No such file or directory'

I just installed Passenger 3.0.11 and nginx and got this error: Starting nginx: /opt/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
user908798
  • 688
  • 4
  • 12
  • 16
29
votes
7 answers

Import CSV Data in a Rails App with ActiveAdmin

i want to upload CSV files through the activeadmin panel. on the index page from the resource "product" i want a button next to the "new product" button with "import csv file". i dont know where to start. in the documentation is something about…
user993460
  • 821
  • 2
  • 8
  • 8
29
votes
4 answers

How do I add Devise's 'timeoutable' module to an existing Devise install? - Rails 3.1

These are the instructions to add a module to an existing Devise install: https://github.com/plataformatec/devise/wiki/How-To:-change-an-already-existing-table-to-add-devise-required-columns But I can't seem to locate the necessary columns for…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
29
votes
4 answers

PostgreSQL -must appear in the GROUP BY clause or be used in an aggregate function

I am getting this error in the pg production mode, but its working fine in sqlite3 development mode. ActiveRecord::StatementInvalid in ManagementController#index PG::Error: ERROR: column "estates.id" must appear in the GROUP BY clause or be used…
Hrishikesh Sardar
  • 2,907
  • 4
  • 21
  • 33
29
votes
2 answers

ActiveRecord objects in hashes aren't garbage collected -- a bug or a sort of caching feature?

I have a simple ActiveRecord model called Student with 100 records in the table. I do the following in a rails console session: ObjectSpace.each_object(ActiveRecord::Base).count # => 0 x =…
AmitA
  • 3,239
  • 1
  • 22
  • 31
28
votes
4 answers

Rails `require': cannot load such file -- matrix

after updating to ruby 3.1.2 and Rails 7.0.2.3 getting following error while starting rails application: `require': cannot load such file -- matrix (LoadError) what could be the possible solution, thanks in advance.
vidur punj
  • 5,019
  • 4
  • 46
  • 65
28
votes
1 answer

What's the proper way to downgrade a gem?

I recently installed the Rails3.1-Devise-Rspec-Cucumber Starter App with the Gemfile listed below. This created a Gemfile.lock file (relevant snippet below) that includes factory_girl 2.0.0rc3. Unfortunately, this version of FactoryGirl is…
cailinanne
  • 8,332
  • 5
  • 41
  • 49
28
votes
4 answers

What is the value of Compass for Rails 3.1?

I'm trying to decide if I should include Compass when starting a new Rails 3.1 project. I haven't used Compass before. Rails 3.1 now supports SCSS directly. The Rails 3.1 asset pipeline (via sprockets) now compiles stylesheets automatically. And I…
27
votes
5 answers

Rails 3.1: Better way to expose an engine's helper within the client app

I have found a few articles addressing the issue of helpers within an engine not being accessible to the consuming (parent) application. To make sure we are all on the same page, let's say we have this: module MyEngine module ImportantHelper …
ynkr
  • 25,946
  • 4
  • 32
  • 30
27
votes
4 answers

Rails - Devise, how can I disable some default routes?

I want to completely disable the routes /users/sign_in for get and post. I was able to successfully override them using the following: devise_for :users do get "/admin" => "devise/sessions#new", :as => :new_user_session post "/admin"…
JohnDel
  • 2,092
  • 8
  • 35
  • 64
27
votes
7 answers

overriding devise after_sign_up_path_for not working

In routes i have the root-path pointing "home#index" but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I sign in or sign up. I have tried to put it in both in devise subclassed controller and…
katie
  • 2,921
  • 8
  • 34
  • 51
27
votes
1 answer

Annotate gem and rails 3.1

Does anyone have any idea why annotate does not work anymore in rails 3.1 ? When trying to run it with : $ rvmsudo bundle exec annotate --position before and given I've got the following in my gemfile: gem "annotate", '2.4.0' I get the following…
vincent jacquel
  • 5,107
  • 2
  • 17
  • 18
27
votes
2 answers

Rails 3.1 on Ubuntu 11.04 via RVM - uninitialized constant Psych::Syck

gem install rails --pre ERROR: While executing gem ... (NameError) uninitialized constant Psych::Syck I can't seem to find any info on how to resolve this. Has anyone else had the same problem? I am using a newly created gemset in RVM with…
phoozle
  • 271
  • 3
  • 5
27
votes
1 answer

Engine's assets with Rails 3.1

How should one provide assets in an engine in Rails 3.1? Where should they be located and can they be included automatically? (originally asked by Tomas Celizna)
Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166