Questions tagged [ruby-on-rails-3]

Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Use this tag only for Rails 3-specific questions, and also tag those questions [ruby-on-rails].

Ruby on Rails 3.0 was a major revision of Ruby on Rails in 2010, the open-source web development framework designed to make programmers happy and productive. Rails 3.0 brings a bunch of new features and improvements over older Rails versions, including:

  • Brand new router with an emphasis on RESTful declarations
  • New Active Record chainable query language built on top of relational algebra
  • Unobtrusive JavaScript helpers with drivers for Prototype, jQuery
  • Explicit dependency management with Bundler

See Ruby on Rails 3.0 Release Notes for more information.

Multiple sub-versions have been released, namely 3.0, 3.1 and 3.2. Questions regarding specific sub-versions of Ruby on Rails 3.0 can also be asked on the appropriate tags:

Resources:

See also:

56082 questions
19
votes
9 answers

Rails + Devise + delayed_job?

I have a Rails 3 App using Devise on Heroku. Problem is I'm sending emails with Sendgrid and email delivery is slow, it makes the app hang. So I'm interested in using delayed_job to queue the email delivery in the background so my app is responsive…
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
19
votes
5 answers

Rails 3 - How to comment in a View?

What is the Rails 3 way to comment out One Line or Multiple lines of code in a View? And so it doesn't show up in the HTML Source
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
19
votes
5 answers

Rails - only find records where has_many associated records are present

I have a model with a has_many relation with another model like so: class Parent < ActiveRecord::Base has_many :children end class Child < ActiveRecord::Base belongs_to :parent end Since there are some parents that may not have children, I'd…
19
votes
6 answers

rails : Could not load database configuration. No such file -

I cloned an app folder from a GitHub repository, and after bundle install the gems, I tried to use the rake db:setup and rake db:migrate commands, neither worked, and here is my error message: **arun997@promanager:~/workspace (master) $ rake…
Arun Anand
  • 201
  • 1
  • 2
  • 3
19
votes
1 answer

render :action with params

I have one Class with 2 methods. The first method is called by the view with some GET parameters ( params[:page] ). I would like to save those params and send them by a render action to my second method. class exemple def first ## sql save of…
Swann
  • 199
  • 1
  • 2
  • 6
19
votes
4 answers

Run a rails query in batches

I have a table A(:name, :address, :phone) consisting of 500,000 entries. I want to run this query : johns = A.where(:name => "John") This query should return 150,000 results. But running this query gives me this result : Killed. How should I…
19
votes
2 answers

Missing script/generate in Rails 3

I just installed Rails 3 and created my first app. The install of Rails3 + ruby 1.9 went very smoothly but I am missing the generate script in script/generate. I have created a new app from scratch with no options to verify. Any idea why this is…
Tony
  • 18,776
  • 31
  • 129
  • 193
19
votes
2 answers

How to check Resque worker status to determine whether it's dead or stale

The default resque web interface says that I have 5 of 7 workers working. I don't understand how this could be happening. I'm on heroku, so when my dyno restarts, it should spin down existing dynos and workers, then spin up new ones. So, I'm…
boo-urns
  • 10,136
  • 26
  • 71
  • 107
19
votes
1 answer

Bug when switching to Rails 4.1 - `method_missing': undefined method `whitelist_attributes=' for ActiveRecord::Base:Class (NoMethodError)

When switching from Rails 4.0 to Rails 4.1 I am getting this error: activerecord-4.1.8/lib/active_record/dynamic_matchers.rb:26:in `method_missing': undefined method `whitelist_attributes=' for ActiveRecord::Base:Class (NoMethodError) I am not…
Mathieu
  • 4,587
  • 11
  • 57
  • 112
19
votes
11 answers

strange bundler error: tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error) on bundle pack

i am getting a strange bundler error when running bundle pack with bundler 0.9.12 any ideas? (see pastie for a better formatted code: http://pastie.org/881328…
z3cko
  • 3,054
  • 8
  • 40
  • 59
19
votes
3 answers

undefined method `t' for Admin::FaqsController:Class

in my project i have controller in namespace admin and I'm using breadcrumbs_on_rails to build breadcrums. My controller looks like: module Admin class FaqsController < Admin::ApplicationController include FaqsHelper …
19
votes
3 answers

How to route controllers without CRUD actions?

I have a controller with a number of actions: class TestsController < ApplicationController def find end def break end def turn end end When I add it to my routes.rb file like so: resources :tests and execute the rake routes…
Roman
  • 10,309
  • 17
  • 66
  • 101
19
votes
5 answers

Convert XML string to hash in Rails

I using some service that returns xml: response = HTTParty.post(service_url) response.parsed_response => "\n\t\n\ntrue\n\n" I need to convert this string to hash. Something like…
Rodrigo
  • 5,435
  • 5
  • 42
  • 78
19
votes
2 answers

Active Admin Ruby on rails Dashboard Controller Error

All of a sudden my app seems to have developed a routing error uninitialized constant DashboardController I am running Rails 3.2.0 with ActiveAdmin (0.6.0) and up until today everything seemed to be working fine. The log is reporting the following…
Tom Pinchen
  • 2,467
  • 7
  • 33
  • 53
19
votes
3 answers

Rails 3, Unknown validator: 'EmailValidator'

I try to add an email-validator in my rails app. I created the following file /lib/validators/email_validator.rb class EmailValidator < ActiveModel::EachValidator def validate_each(object, attribute, value) unless value =~…
Marvin
  • 195
  • 1
  • 1
  • 5