Top "Ruby-on-rails-3.1" questions

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

How to set up factory in FactoryGirl with has_many association

Can someone tell me if I'm just going about the setup the wrong way? I have the following models that …

rspec ruby-on-rails-3.1 has-many-through factory-bot
How to add confirm message with link_to Ruby on rails

I wanted to add confirmation message on link_to function with Ruby. = link_to 'Reset message', :action=>'reset' ,:confirm=&…

ruby ruby-on-rails-3 ruby-on-rails-3.1 ruby-on-rails-3.2 link-to
Clear the cache from the Rails asset pipeline

I'm starting a new project in Rails, and it looks like the application.js manifest file is doing something funny …

javascript ruby-on-rails caching ruby-on-rails-3.1 asset-pipeline
Can we call a Controller's method from a view (as we call from helper ideally)?

In Rails MVC, can you call a controller's method from a view (as a method could be called call from …

ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.1
Rails: How to find_by a field containing a certain string

I have a model named Topic, that has a name as a field. So say I have a term I'm …

sql ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1
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 …

postgresql ruby-on-rails-3.1 production
Subqueries in activerecord

With SQL I can easily do sub-queries like this User.where(:id => Account.where(..).select(:user_id)) This produces: …

ruby-on-rails-3.1 subquery arel
Changing a column type to longer strings in rails

At the first migration, I declared on a column content to be string Activerecord made it to be string(255) according …

ruby-on-rails string postgresql ruby-on-rails-3.1 rails-activerecord
What's the correct syntax for remove_index in a Rails 3.1.0 migration?

I'm in the process of adding Devise to an existing Rails app, with a Users table already defined. The devise …

ruby-on-rails ruby-on-rails-3.1 rails-migrations