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
2 answers

Thin vs. unicorn for development mode on Mac?

I'm shocked that this question hasn't been asked already, but I swear I looked everywhere. Are there advantages of thin over unicorn, or vice versa, when running Rails 3 in development mode?
Jay Levitt
  • 1,680
  • 1
  • 19
  • 28
19
votes
2 answers

Getting actual array of results using Mongoid

With a regular ActiveRecord/SQL setup in Rails, in console when I execute commands *.where, *.all etc., I get back the actual array of record items. However, after switching to Mongoid, I instead get back a criteria. How do I get the actual…
Newy
  • 38,977
  • 9
  • 43
  • 59
19
votes
4 answers

thinking sphinx unknown type 'mysql'; skipping

I'm using ts version 2.0.5, rails 3.0.9 and mysql2 0.2.11 When trying to create my indexes, using rake ts:index, I get the following error: ERROR: source 'technical_core_0': unknown type 'mysql'; skipping. My development.sphinx.conf…
Jenny Blunt
  • 1,576
  • 1
  • 18
  • 41
19
votes
3 answers

Detecting mobile browsers in Rails 3

I'm looking to do some mobile-specific layouts in my app, and have been researching ways to detect mobile browsers and serve mobile specific layouts. I came across this:…
Slick23
  • 5,827
  • 10
  • 41
  • 72
19
votes
4 answers

Rails / I18n: default scope

I'm using the default I18n module for Rails to translate my strings in views. <%= t("registration.heading") %> Now, when I'm in the registration-view, all my strings start with registration. I always have to write <%=…
Markus
  • 5,667
  • 4
  • 48
  • 64
19
votes
6 answers

Remove test::unit

I forgot to create my application with the -T argument and now it's installed with test::unit. How do I remove test::unit and stop it from creating tests for each controller / model generated, after I have already created the application? Thank you
user715697
  • 857
  • 1
  • 10
  • 20
19
votes
5 answers

How can I add gems to my vendor/cache directory in a Rails 3 app?

I use EngineYard, and I have a deployment that is failing. I am getting this message: Some gems seem to be missing from your vendor/cache directory. Could not find rspec-core-2.6.0.rc2 in any of the sources How do I make sure those gems get in that…
RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
19
votes
5 answers

How to use deactivate Webrick's SSL

Last week I tried to debug with SSL activated in webbrick, but I forget how to restore the settings to default(without SSL). Every time I visit a controller, now it shows: SSL connection error Unable to make a secure connection to the server.…
Howard Huang
  • 355
  • 1
  • 4
  • 9
19
votes
3 answers

How can I customize Devise to send password reset emails using PostMark mailer

I'm trying to get all of my system's email notifications under one umbrella using PostMarkApp and utilizing the Rails gems (postmark-rails, postmark-gem, and mail). I have successfully created a mailer that handles sending receipts for purchases but…
grafikchaos
  • 555
  • 1
  • 4
  • 13
19
votes
2 answers

Rails 3 generators in gem

Might sound like a simple question, but I'm stumped. I've created a gem that essentially contains a generator. It contains the following structure: lib - generators - my_generator my_generator_generator.rb (see below) -…
Yule
  • 9,668
  • 3
  • 51
  • 72
19
votes
3 answers

Is a system-wide install of RVM a bad idea?

I'm confused about whether, on a server, you're supposed to install RVM as a regular user or do a system-wide installation, and, if the latter, how you're supposed to do things like bundle install without using sudo. Is there any definite set of…
dan
  • 43,914
  • 47
  • 153
  • 254
19
votes
1 answer

Ruby ternary operator in erb?

How can I make this code look better: <%=raw manuscript.uploaded_to_s3? ? "" : "" %> That is, can the HTML go outside of the ERB block making this easier to read?
Reed G. Law
  • 3,897
  • 1
  • 41
  • 78
19
votes
3 answers

Rails REST routing: dots in the resource item ID

I have following in my routes.rb: resources :users, :except => [:new, :create] do get 'friends', :as => :friends, :on => :member, :to => "users#friends" end and following in my user.rb: def to_param self.login end And when, for example, user…
sandrew
  • 3,109
  • 5
  • 19
  • 29
19
votes
7 answers

AssociationTypeMismatch and FactoryGirl

This has been causing some frustration recently... It seems that using Factories in my cucumber tests, in some situations causes AssociationTypeMismatch errors such as: MyModel(#65776650) expected, got MyModel(#28190030)…
Adamski
  • 191
  • 1
  • 4
19
votes
5 answers

Creating a model that has a tree structure

I have categories that are in a tree structure. I am trying to link them together by defining a parent for each one. (I couldn't figure out how to call the property parent so it's just category for now, but it means the parent). class Category <…
Peter Hall
  • 53,120
  • 14
  • 139
  • 204