ruby-on-rails

Database Development with ASP.NET MVC and other MVC frameworks?

Does the MVC framework, whether it be ASP.NET or Rails enforce you to develop better databases? Since your database tables and fields will most likely map to classes and properties using OR/M, it only makes sense that this would force you to create a proper database structure from the beginning of development. ...

What are the best gems for social networking features?

What are some good gems that allow simple pre-built connectivity and integration with networks like Twitter, LinkedIn, Facebook, etc? ...

Using cucumber and Rspec to develop a SOAP client with BDD

As a learning experience I'm developing a small Rails application that is supposed to query an existing SOAP API/web service (using the handsoap gem) and will simply present the information gathered there to a user. I like using rspec and am getting used to cucumber for testing my applications. The part that has me stumped is how to tes...

Create a new user with new openid login authlogic

hey everyone, I've implemented authlogic in a rails site, and I'm trying to get openid to work correctly. So far, you can login just fine as long as you have an existing account, but not so much if you don't. I'd like to be able to automagically create a new account if the identity_url is not already in the database. The problem is th...

How to join multiple tables with one to one relationships in rails

Ruby on Rails is very new to me. I am trying to retrieve set of columns from 3 different tables. I thought I could use SQL view to retrieve my results but could not find a way to use views in Rails. Here are my tables. 1) User table --> user name, password and email 2) UserDetails table --> foreign key: user_id, name, address1, city etc....

Apache on WIndows - growing VM Size of httpd.exe

I have a Rails app running with Apache on a Windows 2003 server . I am using the Apache Lounge version of apache. Httpd.exe process's Mem usage and VM Size is growing constantly and quite fast, while there is not much load. Most alarming is the VM size, as it appears to be growing at a much faster pace, reaching several GB in a couple o...

Is the Map Rails Kit worth the money?

http://railskits.com/map/ Would you like to launch your own google map mashup? Need a way to easily get data onto a map, but don’t want to have to dig through piles of poorly documented Google Maps javascript code? The Map Rails Kit allows you to deploy a map mashup instantly. It extracts all the Google Maps implem...

Aggregating feeds in Rails application

I am thinking of writing a daemon to loop through feeds and then add them into the database as ActiveRecord objects. Firstly, one problem I am facing is that I cannot reliably retrieve the author/user of a story using the feed-normalizer gem. It appears that some times, it does not recognize the tag (I don't know if anyone else has fac...

Is there a quick way to create random development data for a Rails application?

I'd like to write a Rake task that will load some development data for my app so I can see what the design looks like in the browser with some data populated in there. I've tried hacking together something using ActiveRecord and the Faker gem, but I'm having a hard time keeping it simple and practical. It quickly turns unwieldy. Problem...

"require File.dirname(__FILE__)" -- how to safely undo filesystem dependency?

Some Ruby librararies I'm using use require statements like this: require File.dirname(__FILE__) + '/specification_helper.rb' lib_dir = File.expand_path(File.join(File.dirname(__FILE__), "lib")) require File.join(File.dirname(__FILE__), 'lib/tools', 'version') require File.expand_path(File.join(File.dirname(__FILE__), 'datautils', 'c...

validates_uniqueness_of scoped to multiple columns

When using Validates_uniqueness_of with the :scope option, is it valid to pass an array of columns like this: validates_uniqueness_of :x, :scope => [:y, :z] As I want :x to be unique in the context of both :y and :z If not then how could you achieve this? 2 validations one for each scope? Thanks ...

Resume parser in Ruby/(Rails Plugin/Gem)

Is there any ruby gem/ rails plugin available for parsing the resume and importing that information into an object/form ? ...

Why is this ERB code in a fixture throwing 'undefined method'?

I'm trying to use fixtures to add more complex test data in order to test specific scenarios with the front-end, which is in Flex. I'm not sure this is the right way to go about it with rails. My rails app is a card game and the 'more complex test data' I'm trying to test are various combinations of cards. For example, I want to set up ...

Hoptoad on rails test works but I don't get notified about exceptions...

I set up hoptoad on my prod server and ran rake hoptoad:test. I get the notifier in my hoptoad interface so it seems to work great. But then I forgot to migrate my database after my last deploy so I got a "ActionView::TemplateError" in my production log. This caused a 500 so I feel like HopToad should have notified me about this. Hav...

Trying to define named_scopes and other ActiveRecord relationships on all models.

I'm trying to define a named_scope for all my models in a Rails application. Presently, I've been able to get close to this by writing an initializer for ActiveRecord::Base and putting regular methods in there. Of course, this offers no real advantage when it comes to creating query chains and is probably the least rails-ey way of getti...

How can I import load a .sql or .csv file into sqlite?

I need to dump a .sql or .csv file into sqlite (I'm using sqlite3 API). I've only found documentation for importing/loading tables, not entire databases. Right now, when I type sqlite3prompt> .import FILENAME TABLE I get a syntax error, since it's expecting a table and not an entire DB. ...

What do you prefer for showing your local rails projects to friends?

I develop my rails applications at my local machine. How can I easily show friends of mine the current state of the project? I have heard of tunnlr, but I am a poor student that looks for a free solution:-) Best regards ...

What is the best way to upload a file to another Rails application?

I 've researched and noticed that ActiveResource lack this functionality. So, what is the current state of the art when doing a file upload? One problem with Guillermo's approach is that the request has to be nested, like this: body = { :file => {:uploaded_data => File.open("#{RAILS_ROOT}/public/tmp/" + original_filename), :owner_id =>...

Is it possible to build a web-based chat client without a socket-based framework?

I have heard that web-based chat clients tend to use networking frameworks such as the twisted framework. But would it be possible to build a web-based chat client without a networking framework - using only ajax connections? I would like to build a session-based one-to-one web chat client that uses sessions to indicate when a chat h...

How can I have autospec/test not run the full test suite after everything goes green?

Same question as waloeiii in twitter: How can I have autospec/test not run the full test suite after everything goes green? The next test I write will be red! I'd rather run the full test suite manually. By the way, I tried adding a failing spec: it "should flunk" do flunk end but autospec seems to ignore it when it fee...