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
40
votes
4 answers

Does form_tag work with Simple_form?

I have a form that is using form_tag and not sure how to use it with the simple_form gem. This is how my form looks: <%= form_tag create_multiple_prices_path, :method => :post do %> <% @prices.each_with_index do |price, index| %> <%=…
LearningRoR
  • 26,582
  • 22
  • 85
  • 150
40
votes
6 answers

skip certain validation method in Model

I am using Rails v2.3 If I have a model: class car < ActiveRecord::Base validate :method_1, :method_2, :method_3 ... # custom validation methods def method_1 ... end def method_2 ... end def method_3 ... end end As…
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
40
votes
5 answers

How can I completely disable CoffeeScript in a Rails 3.1 app?

At the moment when I generate a new controller, Rails also generates a .js.coffee file for the controller as well. As I don't use CoffeeScript I want Rails instead generate .js files for me. Is it enough to comment out the coffee-rails gem to…
K Everest
  • 1,565
  • 5
  • 15
  • 23
40
votes
5 answers

How do I turn off automatic stylesheet/javascript generation on Rails 3.1?

I've got a Rails 3.1 project that I'm working on, but I don't want controller_name.css.sass and controller_name.js.coffee to be generated each time I run rails generate controller controller_name. I could swear I've seen the setting somewhere on the…
Ben Kreeger
  • 6,355
  • 2
  • 38
  • 53
39
votes
3 answers

Rails 3.1 - Pushing to Heroku - Errors installing postgres adapter?

I just upgraded to Rails 3.1 and the first app i've tried to deploy to Heroku has encountered a problem relating to Postgres adapter. I'm able to push the app to heroku but then when i try to migrate the database i get the following error: heroku…
tuddy
  • 1,824
  • 4
  • 31
  • 35
38
votes
27 answers

No route matches [GET] "/users/sign_out"

Here is my actual error: No route matches [GET] "/members/sign_out" Since most people will use "users" I thought it would be more helpful to have that in the title. At any rate, I am essential unable to logout. I can successfully edit my member…
Joe
  • 3,352
  • 3
  • 20
  • 19
37
votes
2 answers

Testing Rails 3.1 mountable engine with Rspec

I started making a Rails 3.1 engine, and I'm having a hard time testing it using rspec. First of all, if I run rails g integration_test whatever it creates a regular integration test in tests/integration instead of spec/requests (the rspec-rails gem…
deb
  • 12,326
  • 21
  • 67
  • 86
37
votes
1 answer

How to create schema in sql

As per http://edgeguides.rubyonrails.org/configuring.html and this post I have this in application.rb config.active_record.schema_format = :sql However, it's still creating db/schema.rb (even after I delete it) and more importantly it's not…
vince
  • 2,374
  • 4
  • 23
  • 39
37
votes
2 answers

How to use pg:psql in heroku?

I am trying to detect my db at heroku terminal like this: myapp@ubuntu:~/RubymineProjects/myapp$ heroku pg:info The plugin heroku-sql-console has been deprecated. Would you like to remove it? (y/N) n === HEROKU_POSTGRESQL_JADE_URL…
simo
  • 23,342
  • 38
  • 121
  • 218
36
votes
10 answers

rails 3.1 asset pipeline css caching in development

I'm a bit confused as it seems like the application.css is including itself twice, once when it lists the resources from the manifest and then a cache of that. So when I delete an individual file it still seems to stay alive inside the…
holden
  • 13,471
  • 22
  • 98
  • 160
36
votes
1 answer

Rails: about yield

I saw some code in a Rails v2.3 app. In layout/car_general.html.erb (this view is called by a method in cars_controller) , I saw the code: <%= yield %> <%= javascript_include_tag 'jquery-1.4.2.min' %> <% javascript_tag do %> …
Mellon
  • 37,586
  • 78
  • 186
  • 264
36
votes
5 answers

carrierwave - rails 3.1- undefined method: image_will_change

I get an error that look like this: undefined method `post_image_will_change!' for # app/controllers/posts_controller.rb:43:in `new' app/controllers/posts_controller.rb:43:in `create' I've included this in my "post" model: …
buren
  • 742
  • 1
  • 8
  • 14
35
votes
3 answers

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 => 'git://github.com/rails/rails.git' gem 'pg' gem 'devise' gem…
cola
  • 12,198
  • 36
  • 105
  • 165
35
votes
4 answers

How to use compass with rails 3.1

I have searched and searched and all I could see was that to use compass with rails 3.1 was to just edit the Gemfile like so: gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31' gem 'sass-rails', "~>…
corroded
  • 21,406
  • 19
  • 83
  • 132
35
votes
10 answers

what is the difference between link_to, redirect_to, and render?

I am confused about the main difference(s) among link_to, redirect_to and render in Rails. anyone can please explain.