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
2
votes
1 answer

What's the best UJS way of refactoring link_to_function?

I have the following interface for a baseball-draft oriented hobby project of mine that lets a team owner build a set of criteria to rank players on: Clicking the attributes will add that attribute to the list, give it an importance factor and a…
jay
  • 193
  • 8
2
votes
0 answers

Rails gives me an unique error: RuntimeError: Session collision

I get this error: RuntimeError: Session collision on '"6a17879bbd78f0ee4dbc823e3cd50682"' The app is configured using: unicorn, memcached. session_store.rb is: Bulevard::Application.config.session_store :mem_cache_store, :key => '_bulevard_session',…
Yavor Ivanov
  • 449
  • 3
  • 8
2
votes
1 answer

Getting the Record That Joined 2 Tables

Alright so I have a simple has_many :through relationship in Rails 3.1 class Event < ActiveRecord::Base has_many :invites [...] end class Account < ActiveRecord::Base has_many :invites has_many :events, :through => :invites …
Andrew Theis
  • 933
  • 7
  • 15
2
votes
1 answer

Rails 3 - DB seed data validation

I am seeding a test database in Rails 3.1 through thousands of create calls in the seeds.rb file. A little problem arises when these calls do not pass the model validations: rails will not notify me this, and the seeding goes on correctly until the…
marzapower
  • 5,531
  • 7
  • 38
  • 76
2
votes
2 answers

What's the set up database on Heroku?

I have deployed my Rails 3.1 app with the MySQL database to Heroku and there everything works fine. I mean, into database are saved the chars right (seems to be used UTF charset on a databases on Heroku). But when I will run the command heroku…
user984621
  • 46,344
  • 73
  • 224
  • 412
2
votes
1 answer

How can you speed up the performance of localhost after enabling asset pipeline?

Page loading on my development machine has fallen through the floor since upgrading to Rails 3.1 and enabling the asset pipeline. I used to see page loads taking 1 or 2 seconds but they're now regularly over 10s (on localhost). This is starting to…
Peter Nixey
  • 16,187
  • 14
  • 79
  • 133
2
votes
2 answers

Routing error calling "new" method with nested resource

I have two nested resources: class Customer < ActiveRecord::Base has_many :locations, :dependent => :destroy accepts_nested_attributes_for :locations end class Location < ActiveRecord::Base belongs_to :customer end In routes.rb I…
kranz
  • 599
  • 1
  • 6
  • 23
2
votes
1 answer

Ruby on Rails: Multiple Input Fields in The Same Form - Change ID/Value

Have a page where there are multiple input fields of the same thing, Posts. Right now, when a user enters in a question for, let's say 3 fields, the only one that saves to the database is the last one. Whereas, it should save all three and give them…
James F
  • 916
  • 2
  • 11
  • 19
2
votes
2 answers

correct way to find max value with association rails

I have the following models: #equipment.rb class Equipment < ActiveRecord::Base belongs_to :odometer_type has_many :odometers end #odometer.rb class Odometer < ActiveRecord::Base belongs_to :equipment # I am currently doing this to find…
Toby Joiner
  • 4,306
  • 7
  • 32
  • 47
2
votes
1 answer

Force Rails to use Ruby 1.8.7 syntax but keep using ruby 1.9.2

I know this sounds strange, but on my development box I can't go back to 1.8.7 because installing Passenger and the Mysql Ruby gem with MAMP was a huge pain in the behind and I don't want to mess with it now that it's working. However, for…
kakubei
  • 5,321
  • 4
  • 44
  • 66
2
votes
3 answers

Paperclip giving wrong url. How to fix?

My paperclip path in the model is: has_attached_file :image, :path => ":rails_root/app/assets/images/article_images/:id/:style_:basename.:extension" But when I call article.image.url, here is the url I get (which is…
user1049097
  • 1,901
  • 4
  • 22
  • 35
2
votes
2 answers

Ruby on Rails: Multiple Same Input Fields in Same Form

Have a page where there are multiple input fields of the same thing, Posts. Right now, when a user enters in a question for, let's say 3 fields, the only one that saves to the database is the last one. Whereas, it should save all three and give them…
James F
  • 916
  • 2
  • 11
  • 19
2
votes
2 answers

How to get started with Backbone.js and Rails 3.1

I am trying to learn both Rails and Backbone.js at the same time. I have completed tutorial here: http://ruby.railstutorial.org/ and now I am trying to get started with Backbone.js. I planning on using Sprockets for assets packaging but for right…
lanan
  • 2,742
  • 3
  • 22
  • 29
2
votes
2 answers

Why is Net::HTTP timing out when I try to access a Prawn Generated PDF?

I am using Prawn to generate a PDF from my controller, and when accessed directly at the url, it works flawlessly, I.E. localhost:3000/responses/1.pdf However, when I try to generate this file on the fly for inclusion in a Mailer, everything freezes…
Oranges13
  • 1,084
  • 1
  • 10
  • 33
2
votes
1 answer

import local .css.less file with rails 3.1 + less-rails

Using rails 3.1 and less-rails (>= 2.1.1): Is anyone out there successfully using @import to include local .css.less files? I'm using the following file structure to try to do so: application.css: //= require less less.css.less: @import…
kclair
  • 2,124
  • 1
  • 14
  • 18
1 2 3
99
100