174
votes
20answers
29k views

Using Rails 3.1, where do you put your “page specific” javascript code?

To my understanding, all of your javascript gets merged into 1 file. Rails does this by default when it adds //= require_tree . to the bottom of your application.js manifest file. This sounds like a ...
45
votes
7answers
10k views

How to make Rails 3.1 use SASS (Over SCSS) as the default?

Having a hard time figuring out how to make SASS, not SCSS, as the default for stylesheets. I've tried making a sass_config.rb file with this: Sass::Plugin.options[:syntax] = :sass ...
4
votes
2answers
1k views

Rails 3.1 limit user created objects

I would like to limit the number of model Objects a user can create. I've tried the below but it is not working. I understand some changes have happened in rails 3.1 and not sure how to accomplish ...
56
votes
9answers
23k views

Upgrading from Rails 3 to Rails 3.1 [closed]

How do you upgrade from Rails 3 to Rails 3.1 beta?
22
votes
2answers
887 views

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 = ...
11
votes
4answers
9k views

Error while creating new Rails 3 project : `require': cannot load such file — openssl (LoadError)

When I try to create a new project($ rails new first_app) it gives following error after creating directory structure. ... ... create vendor/plugins/.gitkeep run bundle install ...
8
votes
5answers
6k views

“Certificate verify failed” OpenSSL error when using Ruby 1.9.3

I'm using Ruby 1.9.3p0 on Mac OS 10.6.8 (installed using rvm). When I attempt to create a new Rails application using an application template hosted on GitHub, with this (for example): $ rails new ...
15
votes
4answers
8k views

Rails 3.1 absolute URL to an image

I'm using Rails 3.1. I'm trying to figure this out, and to my surprise, it is starting to seem that rails does not come with this method at all. Maybe im wrong. Can anyone show how I can get a full ...
5
votes
7answers
5k views

rvm install: ruby installation error

I want to install ruby on my Linux Mint 12. I am following this tutorial and this one. when I run rvm install 1.9.3 I see this error: Installing Ruby from source to: ...
9
votes
1answer
6k views

Phusion Passenger is throwing errors after upgrading Ruby and Rails using rvm

I recently upgraded my Rails setup to 3.1.3 and I'm having issues with Phusion Passenger loading an older app on this server. I got everything running on a testapp but I'm still having issues with ...
6
votes
8answers
2k views

Redirect user after log in only if it's on root_path

I have a root_path on my Rails application that is not user-protected i.e. it's a simple portal homepage, with a login form. After the users log in, I'd like it to go to dashboard_path. I've done ...
3
votes
1answer
3k views

Find number of months between two Dates in Ruby on Rails

I have two Ruby on Rails DateTime objects. How to find the number of months between them? (Keeping in mind they might belong to different years)
2
votes
1answer
137 views

Trouble on eager loading “second degree” associated objects

I am running Ruby on Rails 3.1. I would like to eager loading "second degree" associated objects by applying some conditions, but I am in trouble. It seems that I already solved part of my issue by ...
0
votes
2answers
483 views

Rails 3 - Devise/ActionMailer/RUBY-SMTP causing a segmentation fault

OK - I'm in way over my head here. I'm using: - ruby-1.9.3-p0 - rails-3.1.3 - mail-2.3.0 - devise-1.5.3 Trying to turn on Devise's :confirmable option and start up smtp services in my app. ...
26
votes
3answers
8k views

ERROR NoMethodError: undefined method `debug_rjs=' for ActionView::Base:Class

This project was built with rails 3.0.9. Now i updated the gems and Gemfile => source 'http://rubygems.org' gem 'rails', '3.1.1' # Bundle edge Rails instead: # gem 'rails', :git => ...

1 2 3 4 5 7
15 30 50 per page