Browsing all articles from March, 2009

Upgrading to Rails 2.3 with git

Posted Posted by Wes in Ruby on Rails     Comments No comments
Mar
30

I upgraded an application to Rails 2.3, starting with making a new empty branch and using that merge back to a staging branch, which is very well described by Olly at the Bamboo Blog.

I had a few issues, which I thought I would collect here in case anyone else has them.
read more

Updating textarea with Ajax: unterminated string literal

Posted Posted by Wes in Ajax, Ruby on Rails     Comments 1 comment
Mar
18

If you try to update a textarea with newlines in it via Ajax, you may get an “Unterminated string literal” error. The update coming back may look like this:

$('textarea_to_update').value='line one
line two
line three';

This will fail because the javascript will interpret the newline as the end of the command.

So, replace those newlines with the newline character and the textarea will get updated correctly:

textarea_value.gsub!(/\n/, '\n')

Visualizing git history

Posted Posted by Wes in Version Control     Comments No comments
Mar
10

I’ve been using git for version control on a new project. Instead of needing a connection to the server (as CVS and SVN do), changes are stored locally.

Every once in a while, I want to poke back the history. git ships with a graphical repository viewer, but I like gitx better.

git makes branching off to try something super easy, which is quickly becoming one of my favorite features. I can create a branch quickly, try something out, switch away and come back later if I want.

Using gitx to view my repository history, I can quickly find where branches diverged and it’s just kinda neat to look at.

about databasically

We live and work in Kansas City, USA.

We're passionate about helping small businesses succeed and want to help you use technology to get more done.

From server, desktop, network management to programming custom web applications in Ruby on Rails, we're here to lend a hand.

Contact us if you have any questions!