rornoob.com

 

Getting memcached working with rails3 on Mac OS

It should be straight forward and usually is, but can you do if your rails application fails to get a memcached connection?

** in .gitignore

How to exclude temp files in .gitignore - why wont the double star symbol work? Here's why.

Sort it out - quick guide to ruby sort

Look how easy ruby makes it to sort arrays of objects; simple sort, reverse sort, sort by multiple attributes

Disappearing attributes... was I duped?

Showing a list of attributes that appear on either object A or it's parent should be really easy right? So why do some attributes "magically disappear"? It seems my array copy is to blame...

Beware of comments in ruby 1.8.7

I can across a strange bug when upgrading to ruby enterprise 1.8.7 - one of my views displayed incorrectly after the upgrade but it was fine beforehand. At least the workaround is easy!

Rails flash[] messages not clearing

Sometimes rails flash[:notice] messages seem to "stick around" for a while - sound familiar? I was initially stumped, but the solution is an easy one...

Creating nested objects with validation of parent id

Nested attributes in rails 2.3.3 can really simplify the updating of nested models, but creating nested models throws up an interesting problem when your model uses validates_presence_of

rspec route_for tests failing

Don't you hate it when your tests work on one server but not on another? That happened to me today and I've traced the problem down to a different version of rspec which requires a different syntax.

Problem using ActiveResource "find" with conditions

I can't get the ActiveResource find method to return the correct results when passing through conditions - it's like my :params parameter is being ignored.

Passing error messages to ActiveResource get

How can I return an error message to an ActiveResource get request? The ActiveResource model doesn't seem to receive anything other than the http error code.

Where is :unprocessable_entity ?

I've been working on some existing code that handles restful authentication. I noticed that the code returns :status => :unprocessable_entity if the login fails. That sounds reasonable, but what actually is that status code, and what other status codes are available should I wish to return different results depending on whether say, the user_name is invalid, or the database is unavailable?

The manager-worker problem

Lets jump right in with a technical question here... In part of our legacy system there's a manager-workers relationship. How can I best manage this in ruby on rails given the constraints of the legacy DB structure?

A ruby on rails adventure begins...

Ruby is different, and rails is kind of magic at times. Surely if I'm learning ruby on rails I can help others learn too. So come onboard, join the conversation - no question's a dumb question here at RoRnoob.com