Questions tagged [ruby-on-rails-3.2]

Ruby on Rails version 3.2.0 released at January 20, 2012. Use this tag for issues related to development in Ruby on Rails version 3.2.0.

Ruby on Rails version 3.2.0 is a specific version of Ruby on Rails. Released on January 20th, 2012. It has been succeeded by version 3.2.15. It brings many improvements to the Ruby on Rails web development framework.

The distinct features include:

  • Faster development mode: only modified classes are reloaded giving a visible performance boost.
  • Automatic Query Explanation: database queries taking longer than 30 seconds to execute are automatically explained while in development mode.

Further reading:

Related tag

6982 questions
2
votes
2 answers

In a Rails app, what is the Rails Way to organize non-model utility classes?

I'm abstracting the payment gateway I'm using out a a Subscription class and into a PaymentGatewayApi class so that it can be easily changed in the future without touching models. My APIs are located in app/api which appears to be just fine as I…
RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
2
votes
1 answer

ruby on rails application managing cookies with varnish cache

I want to implement varnish with my newly deployed rails web application. Rails version 3.2.12 with Ruby 1.9.2p318 (2012-02-14 revision 34678) [i686-linux] In my application user authentication is done by cookies but varnish is not caching content…
bilash.saha
  • 7,226
  • 2
  • 35
  • 40
2
votes
3 answers

Facebook Graph API: Get user city (location)

I have currently implemented facebook login and taking access of user's location. Like this: user.profile.city = auth.info.location I need only city of user, but location gives city and state. As per permission docs, location is user's city.…
user2206724
  • 1,265
  • 3
  • 20
  • 38
2
votes
0 answers

Redmine 2.3 relative url root not working with Apache mod_proxy

I am currently attempting to upgrade from Redmine 1.4 (based on Rails 2.3) to Redmine 2.3 (Rails 3.2). I am forced to use Apache with mod_proxy and proxy balancer, so any talk of passenger is out. I am trying to deploy Redmine on a sub-uri…
2
votes
2 answers

How to upcase model names in localised Devise error messages?

I am using Devise in my Rails app and I wonder why it downcases all my model names in its error messages: Source code on Github Is there any way to override this? In German, for example, nouns start with capital letters, e.g. "Benutzer" is correct,…
Tintin81
  • 9,821
  • 20
  • 85
  • 178
2
votes
4 answers

Development log: ActionView::Template::Error (undefined method `name' for nil:NilClass):

I'm a newbie and this is for the Rails tutorial by Richard Schneeman. This is all that is in my index.html.erb file in my view/products folder. <% first_product = Product.first %> <% lots_of_products = Product.includes(:user).all %>
    <%…
ltrainpr
  • 3,115
  • 3
  • 29
  • 40
2
votes
3 answers

How to display the first 10 characters only of a message stored in database?

In my inbox view, where I am able to list each individual message, I want to display the first 10 characters of a message if the message is larger than 10 characters or display the entire message. The user can then click on the message to view the…
2
votes
0 answers

ActiveResource Update Operation :: Can't mass-assign protected attributes: created_at, id, updated_at

When I try to update and save ActiveResource I am getting following error. on console > m = Machine.first => #"2013-04-22T09:13:56Z", "id"=>1, "name"=>"laptop", "updated_at"=>"2013-04-22T09:13:56Z"},…
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
2
votes
2 answers

How to prepare raw sql statements with dynamic binding in Rails using ActiveRecord::ConnectionAdapters?

I use MySQL DB and MySQL2 as adapter. I want to execute custom sql-statements in Rails. I need a method that would allow to prepare sql-statements like in PHP, like this: stmt = prepare("INSERT INTO tab (col1, col2) VALUES (?, ?)", ["foo",…
Green
  • 28,742
  • 61
  • 158
  • 247
2
votes
1 answer

Select unique records ordered by date

I have 2 following models: class Schedule < ActiveRecord::Base attr_accessible :description, :deadline_on, :repeat has_many :scheduled_transactions end class ScheduledTransaction < ActiveRecord::Base attr_accessible…
user882027
  • 57
  • 1
  • 6
2
votes
2 answers

How to return string of role names with rolify

I'm trying to return the name of all the roles a user has in the following format: 'rolename1','rolename2','rolename3' So that I can user the has_all_roles? method from rolify. I've tried collecting the role names like this: user.roles(:select =>…
Webjedi
  • 4,677
  • 7
  • 42
  • 59
2
votes
1 answer

How to integration test two Rails apps

We have two separate Ruby on Rails apps, one that accepts uploaded files, the other that produces files from the uploads the other app received. We're trying to put together end-to-end blackbox regression and integration tests that demonstrate that…
Daniel Ashton
  • 1,388
  • 11
  • 23
2
votes
2 answers

Testing acts_as_tenant with rspec

I have a multi-tenancy app using ascts_as_tenant. I am trying to write a spec that tests a scope. So I want to test the output of User.active. In general this works fine with code such as the following it "returns a correct active user" do …
2
votes
1 answer

Is it possible to conditionally load certain JS assets in the Pipeline?

I am using Stripe to let users subscribe to my Rails 3.2 application. I have a Subscription model, and in the JS asset I call the Stripe object. But I only include the Stripe javascript file in a special layout file for the Subscription process.…
RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193
2
votes
1 answer

Embed PDF file into webpage from online source, which requires download of the file with "Content-Disposition:" tag in HTTP-headers

I need to display the PDF files from a third party on a webpage. I have links to the documents as they appear on the source pages. Unfortunately, none of the links are actual links to the documents, but rather GET requests with certain parameters,…
Pets
  • 115
  • 10