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
34
votes
9 answers

Ruby on rails log file size too large

I stumbled to learn that my rails3.1 log file is super large, around 21mb. Is this, in terms of size normal? What the log file would like in the production environment? Besides, can I get rid of the log?thanks
Jason
  • 371
  • 1
  • 4
  • 7
33
votes
6 answers

How to build task 'assets:precompile'

I'm getting that error on my production server, and can't figure out why. It happens when running this command: bundle exec rake assets:precompile RAILS_ENV=production I'm using Rails 3.1.0.rc6
33
votes
1 answer

Rails before_filter for specific actions in controller

def new before_filter do redirect_to "/" unless current_admin || current_company flash[:notice] = 'You dont have enough permissions to be here' unless current_admin || current_company end CODE CODE CODE end def…
Mau Ruiz
  • 767
  • 1
  • 8
  • 22
32
votes
6 answers

.tooltip() is not a function

I am trying to use the .tooltip() that I found from the following: Jquery-ui tooltip. What I have is a rails app that has some information in a table. In separate cells. Currently you can view the full information of a cell by clicking it which…
Deej
  • 5,334
  • 12
  • 44
  • 68
32
votes
7 answers

Using @font-face with Rails 3.1 app?

I'm having trouble using the following @font-face declaration to work with my Rails 3.1 app. I put the fonts in the Asset Pipeline in its own folder called "Fonts" alongside images and stylesheets and javascripts Here is the declaration I used…
pruett
  • 2,101
  • 3
  • 22
  • 36
32
votes
1 answer

what does ?body=1 do in rails 3.1 asset pipeline?

In development, all my javascript assets are being appended with the body=1 get variable. What is this actually doing? http://localhost:3000/assets/application.js?body=1
Lee Quarella
  • 4,662
  • 5
  • 43
  • 68
31
votes
2 answers

Reprocessing images in Carrierwave

Let's say my model has an image with :thumb and the client wants :tiny and :nano thumbnails. How do I reprocess all the existing images using a rake task? I've found a rake task that I thought would do it https://gist.github.com/777788 but it's…
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84
31
votes
5 answers

Array Attribute for Ruby Model

Is it possible to create an attribute for a class that is an array? I tried reading this but I didn't get much out of it. I want to do something like this: class CreateArches < ActiveRecord::Migration def change create_table :arches do |t| …
tquarton
  • 599
  • 2
  • 6
  • 10
31
votes
4 answers

When to create a new controller in rails

I'm wondering when you know that you need to create a controller in a rails application. For example, I'm going through the tutorial in Agile Web Development with Rails and the application creates several models, all with seperate views and…
user469809
31
votes
3 answers

What is the purpose of config.assets.precompile?

In Rails 3.1, you must whitelist files that you want included in asset precompilation. You must open up config/environments/production.rb and explicitly include assets you want precompiled: config.assets.precompile += ['somestylesheet.css'] If you…
dhulihan
  • 11,053
  • 9
  • 40
  • 45
31
votes
2 answers

How to disable ActionMailer in Development?

sometimes when I am developing, I do not have an internet connection. This results in an error wherever my app is supposed to send an email: getaddrinfo: nodename nor servname provided, or not known Is there a simple and quick way where i can…
31
votes
7 answers

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 absolute URL to an image? I use…
alik
  • 3,820
  • 9
  • 41
  • 55
31
votes
4 answers

Where to override current_user helper method of devise gem

How can i override current_user of devise gem. Actually I need to add web services for mobile-app. Currently devise is managing session and 'current_user' for web-application. Now Mobile app will send user_id to the server. I need to override…
30
votes
10 answers

Rails Errno::EACCES Permission Denied

Rails 3.1 Passenger on Apache Development environment When I go to access the index (i.e. GET) for a route I get: Errno::EACCES in Crb_agendas#index Showing /var/www/crbagenda/app/views/layouts/application.html.erb where line #5 raised: Permission…
ScottJShea
  • 7,041
  • 11
  • 44
  • 67
30
votes
7 answers

heroku run console returns 'Error connecting to process'

I have deployed a rails 3.1 app to Heroku Cedar stack, and am trying to perform a: heroku run rake db:migrate it returns: Running console attached to terminal... Error connecting to process I also try to simply launch the console: heroku run…
jdcravens
  • 577
  • 1
  • 4
  • 15