s

Posts Tagged with "rails"

Ruby on Rails having problems with table column names

Jun 15, 2006  -  Comments

I was working on a project for work today that invloved the client be able to enter customer testimonials into a database to be displayed randomly on each site page. I named the table quotes and it had three columns: id, person, and quote. I made id an integer and quote and person were both varchars. Everything worked fine with this configuration.

After some testing, I discovered that a varchar wasn't the best type for the quote because it didn't have enough room for the longer testimonials. Like a good Rails developer, I wrote a migration script to change the quote column to be text instead of varchar. Well, after making this change, Rails bombed every time I tried to add another quote. For some reason, it didn't like the column to be of type text and have the same name as the Rails table object. I'm not exactly sure what or why specifically caused this problem, but it definitely didn't work. After some consultation with The Shawnami, the resident Rails guru, and some extensive frustration, we finally decided to try and just rename the column. Guess what? It worked perfectly after I renamed it content.

Tagged: railsdb

Live

May 28, 2006  -  Comments

The blog is now live! I wrote this to get some practice with Ruby on Rails. The whole process was suprisingly easy. Rails does almost all of the work, so it only took me about two weeks to get the whole thing built in my spare time. Even a chunk of that time was spent designing the layout. I'm not very creative, so I had to look at a lot of other blogs before I could get enough ideas to rip off.

To fill it out a little bit, I've copied over around 12 posts from an old LiveJournal that I used last year when I was in France for two months.

Tagged: rails