Archive for July, 2009

How to Truncate in Models


I recently had the difficult time of trying to truncate a string in a model. Rails enforces this policy because truncation is thought to be in the domain of the view of the data. This makes sense, because you are “seeing” a portion of the string. However, in this case, I was using the truncated string in the generation of an SEO-friendly URL. Read the rest of this entry »

  • Share/Bookmark

No Comments

How to stop the server in Rails

It is quite simple to do, just need a little Linux know how.

To stop the server you need to kill it. Thus you use the

kill

command. Not so fast, you first need the “pid” for the process. Much like in Windows where you open the task manager and you kill a process. Unfortunately it isn’t so easy in Linux/Mac. Read the rest of this entry »

  • Share/Bookmark

No Comments

Useful MySQL commands with Ruby on Rails on a Mac or in Linux

Because RoR is so high level often times you can feel disconnected with what’s under the hood. Often times you need to view what objects, or columns, you are working with. Or you delete columns. Here are a handful of common mysql commands that I use often in RoR. Read the rest of this entry »

  • Share/Bookmark

, , ,

No Comments