ruby-on-rails

Weird problem with Rails and Adobe Livecycle pdf

I'm building a site in which a catalog (of products) is shown and when clicked a Adobe Livecycle generated pdf will be opened. There are a few form fields and when the submit button is pressed, the fields will be submitted to the url http://localhost:3000/pdf-parser. This file gets all the parameters and can store them in the database. ...

Ruby on Rails scalability/performance?

I have used PHP for awhile now and have used it well with CodeIgniter, which is a great framework. I am starting on a new personal project and last time I was considering what to use (PHP vs ROR) I used PHP because of the scalability problems I heard ROR had, especially after reading what the Twitter devs had to say about it. Is scalabil...

What can you NOT do in Rails that you can do in another framework?

I'd like to know situations in which I should consider using a framework other than Rails. ...

Does the Rails ORM limit the ability to perform aggregations?

I am concerned whether Rails can handle the types of complex aggregations that are needed for a financial application and particularly whether the ORM can handle these effectively. In a financial application that I am thinking of using this for, there is a need to do lots of reporting of detailed financial data, aggregated in various way...

Ruby on Rails Newbie

Hello. I've inherited a Ruby on Rails application that has a problem. I'm half way through some books on Rails, but haven't seen the answer to some questions yet. What is the best way to backup the application? Can I just tar -cvzf app.tgz app? I don't know yet if the app has a sqlite3 database or connects to a db server. What's the b...

Writing To The Response in Rails? (Like "echo" in PHP)

I know that I can do this in Rails: <%="hello" %> but is there any way to do this <% echo "hello" %> and get it to show up in the response? I have tried response.write which almost worked, but did not... Edit: print or puts do not do it, because I do not want to write to the console. I want to write to the browser/HTTP client. Ed...

What are the best Ruby or Rails blogs?

So what are your favorite Ruby or Ruby on Rails blogs? One link per post please and short description would be nice. ...

What do you mean Ruby on Rails is not thread safe?

I was just reading up on ROR (haven't dived into it yet), and I hear that it isn't thread safe. Obviously, this doesn't mean that more than one person can't access your site at one time, so what exactly does it mean? Where do threads come into play in ROR? Do they just mean the request handling? ...

What are the main syntax changes in Ruby 1.9?

Also, I'm wondering what effect upgrading to Ruby 1.9 would have on legacy code from version 1.86. Is the new version backwards compatible? ...

Javascript on page is not executing before AJAX onComplete event is called

I have a form that makes an Ajax POST request to insert a widget into my database. In the form, I have a select box where you can select from the widgets. After the db insert is made, I must update the select box. I actually just replace the entire form for now. Because the select box has the widgets, I must have a copy of the obje...

acts_as_ordered Rails plugin not working

The acts_as_ordered plugin isn't ordering records in my Ruby on Rails app. I have the following models quiz.rb class Quiz < ActiveRecord::Base acts_as_ordered :order => 'created_at DESC' validates_presence_of :name, :user_id belongs_to :user has_many :questions before_destroy :delete_questions end question.rb class Ques...

How do you remember/organise Rails information to prevent wheel reinvention?

I love working with Rails but I keep tripping up against my own inefficiency: I'll spend time implementing some "useful" function only to discover subsequently that it was already in the framework, had I but known it! Particular areas of wheel reinvention for me are helpers and built-in class extensions recently-released features that...

Uploading Rails Apps with MediaTemple

Any recommendations of a recent tutorial, or guide, on uploading Rails applications to a (gs) rails container? I've followed a couple tutorials already, both of which haven't worked. ...

Dealing with "hypernormalized" data

My employer, a small office supply company, is switching suppliers and I am looking through their electronic content to come up with a robust database schema; our previous schema was pretty much just thrown together without any thought at all, and it's pretty much led to an unbearable data model with corrupt, inconsistent information. T...

Formatted pluralize

I have a case where I need to use pluralize to properly spell something. However, I need to render the html like so: <span>1</span> thing or, <span>3</span> things I could write a helper method, but I'm just making sure there isn't something in the box to do this. ...

ActionMailer best practices: Call method in the model or the controller?

Sending an email is usually called after an action on a model, but the email itself is a view operation. I'm looking for how you think about what question(s) to ask yourself to determine where to put the action mailer method call. I've seen/used them: In a model method - bad coupling of related but seperate concerns? In a callback i...

Best practice for Rails App to run a long task in the background?

I have a Rails application that unfortunately after a request to a controller, has to do some crunching that takes awhile. What are the best practices in Rails for providing feedback or progress on a long running task or request? These controller methods usually last 60+ seconds. I'm not concerned with the client side... I was plann...

Validating user's API credentials - Rails, ActiveMerchant, and PayPal Express Gateway

I'm building a marketplace application that uses PayPal Express. I've got a form for sellers to input their PayPal API credentials, but I need a way to validate them by making some sort of call to PayPal. I'm using the PaypalExpressGateway in ActiveMerchant, and I don't see anything other than the standard purchase controls. Is there ...

Autotest performance slowdown

I've been using ZenTest to run all the tests in my Rails project for years and it's always been quite nippy. However, on my Mac it has suddenly started taking 3 times as long to run all the tests. We have 1219 tests and for the past year it would run all the tests in around 300 seconds on average. Now though, it's taking almost 900 se...

limitations of :finder_sql

In a rails app, I using the :finder_sql option in a has_many declaration. The rails docs say that when I do this, "find_in_collection is not added." What does this mean? ...