Category Archives: Web Design

ruby, javascript, html, css, and other languages

How To Migrate From Joomla to WordPress

A wizard to help you move blog posts from Joomla to Wordpress. Exports the post from Joomla and imports them into WordPress. Continue reading

Posted in Bookmarks, wordpress | Leave a comment

What’s so Great About WordPress – the Radio Show

Sustainable Websites founder Ivan Storck will be on a live podcast tomorrow at 1pm PST. Call in with your WordPress questions! Many people think that WordPress is only for bloggers. Not true! Lee and Ivan will talk about why WordPress … Continue reading

Posted in Technology, wordpress | Tagged , , | Leave a comment

Render error when upgrading from rails 1 to rails 2

When upgrading an old ruby on rails 1.2 application to rails 2.2.2, I ran into a frustrating, somewhat un-google-able error, so I’m writing down the solution here. If you get a render with invalid options error, the solution is to … Continue reading

Posted in rubyonrails | Tagged , , , , | Leave a comment

Issuu Really Wants to Kill The Document Download

One thing that I find increasingly anachronistic on the Web is the stubborn persistence of the PDF download. I really don’t need to download more junk onto my computer, especially if it is only something I am going to look at once or twice. Every document should just be viewable (and searchable) on the Web. That is why I am a big fan of services like Issuu, Docstoc, and Scribd that let you embed PDFs and other documents on any Webpage.

Today, Issuu (which raised $5 million in October) is introducing something it calls Smart Look, which turns all the document-download links on your site into browser-viewable documents. It works for PDFs, slideshows, or regular text documents. You just insert some code onto your site, and it does the rest. Instead of an embedded viewer, it launches a new overlay window where you can see the document in all of its glory, search it, page through it, and even print it (if you still do that kind of thing).

Once you insert the code, it turns on this feature for all document downloads on your site, instead of requiring you to create an different embedded viewer for each document.

You can check it out some on this sample site or watch the video below:

Crunch Network: MobileCrunch Mobile Gadgets and Applications, Delivered Daily.

Continue reading

Posted in Web Design | Leave a comment

OpenSocial now friends with PHP, Java, Ruby, and Python

With more and more containers introducing server-to-server APIs based on the OpenSocial REST and RPC protocols (think MySpace, LinkedIn, Plaxo, orkut, and iGoogle just for starters), it has never been a better time to jump into OpenSocial development. These new protocols allow you to write engaging social applications for these containers using the language of your choice — JavaScript is no longer the only option.

To help you get started using the OpenSocial REST and RPC protocols, we have assembled a set of client libraries for PHP, Java, Ruby and Python. Each library enables developers to retrieve profile information and persistent data from supporting containers without having to concern themselves with managing network connections, signing requests, or other lower-level details. To check out the code, point your browsers to the Source tab linked from each project’s home page:

These libraries are completely open sourced under the Apache 2.0 license, and contributions are not only welcomed but encouraged. In addition to a wiki page explaining the patch submission process, each project hosts an issue tracker which have already been populated with known issues and requested enhancements. These trackers are the best places to start if you’re interested in contributing to a particular project. Please report any new bugs or incompatibilities you find along with any feature requests using these trackers and be sure to star those reported by other developers which are significant to your own development also so they can be prioritized effectively.

To help get you started, we have assembled a set of sample applications, linked from the project wiki pages, which you can run directly from the command line or your favorite IDE. As an added bonus, the Ruby and Python libraries have accompanying full-featured sample applications which you can run inside containers supporting the OpenSocial REST protocol. These larger samples are checked in to the Subversion repository under “Samples” and include a bootstrap mechanism for securely retrieving the ID of the current viewer before the core application loads, which you can use as a template for your own container-based applications.

For general questions and commentary, we have set up a discussion group to help build the developer community around the libraries. The original engineers of each library are already members of the group, so feel free to ask the tough questions. :) We will also be hosting a special session of IRC office hours next Monday, December 22 from 1:00 to 3:00 (PST) so you can share your feedback with us directly. The official OpenSocial IRC channel is located at irc://irc.freenode.net/#opensocial.

We’re really excited to see the next generation of social applications that the OpenSocial server-to-server APIs enable, and we hope the client libraries ease you along your development journey. Please give the libraries a spin, file any issues you see, and stop by the IRC channel next week to get your questions answered. See you there!

Continue reading

Posted in Web Design | Leave a comment

Building a Blog in 15 Minutes with Rails 2.2: A New Screencast

rails22screencast.png

Anyone who got into Rails a few years ago should remember a very popular "building a weblog in 15 minutes video" by David Heinemeier Hansson. It was potentially responsible for most of Rails' ongoing success as the video demonstrated all of the beauty of Rails in an easily digestible way (if you still want to see this historic video – based on Rails 0.5! – click here). Now, Ryan Bates of Railscasts.com fame has recorded a new 15 minute "creating a weblog with Rails 2.2" video (50MB, Quicktime format).

For more information generally, go to http://rubyonrails.org/screencasts

Continue reading

Posted in Web Design | Leave a comment

jQuery on Rails: Why Bother?

In which I explain why I use jQuery at times and how you can as well. Oh, and I provide a wealth of links. Links are fun!

A few people have suggested that I post about how to use jQuery with Rails. I thought about it and felt that others have already covered it quite well but why not collect their posts here for you to enjoy, right? Plus, I do all my JavaScript from scatch so I do not really ever use the helpers Rails provides and as such could not post intelligently on them.

So John, When Did You Quit Prototype?

I haven’t! I do not intend to ever quit using Prototype. Honestly, I have used jQuery quite a bit less than Prototype. I have found that jQuery and Prototype are both great and in different situations I will use a different library. The one thing I will say is even if you don’t actually switch to jQuery, I think it is important to learn new things and stretch yourself. It is good to feel frustrated and like a beginner. Also, jQuery takes a very different approach which has actually helped me write better Prototype code. Hope this is helpful and not overwhelming. :)

Creating A Plugin

Addicted to New jQueryToday, I wrote an article on How to Create a jQuery Plugin From Scratch over on my Addicted To New site. I picked out the most basic thing a plugin could do and explained each step in a lot of detail. Give it a read if you are into Prototype but are curious about jQuery.

Live Search and Fancy Zooming

Ordered List jQueryAfter creating my live search with quicksilver for prototype example, I decided to port it to jQuery (view demo). Then, humbly, I was corrected by the jQuery man himself, John Resig, who re-ported my port in a more jQuery-ish functional style. For those that are curious, I also massaged the AJAX-RDoc project to use quicksilver searching. This is really helpful when you can’t quite remember a method name.

Likewise, when I created fancy zoom for prototype, my partner in crime, Steve Smith, created a port of fancy zoom for jQuery (view demo). Fancy Zoom is great for showing text and images with an Apple-esque, in page zoom transition or even Flash if you have a video you would like to feature.

jQuery Railscast

RailsCasts jQueryRyan Bates did an awesome job showing how to use the jQuery on Rails plugin with Rails in a recent screencast. He also gave a really quick example on how to create a plugin. I would recommend watching this and subscribing to his Railscasts, which are great.

jRails Plugin

RailsCasts jQueryjRails is a drop-in jQuery replacement for Prototype/script.aculo.us on Rails. Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library. Ryan shows how to use it in the screencast mentioned above, but I thought I would also mention it separately. If you are a fan of the Rails javascript/ajax helpers, this plugin is for you. It makes each of them work with jQuery and has some nice demos on the site.

Link Love

While dispelling the myth that Rails is tied to Prototype, DHH gave some jQuery examples.

Brandon showed how he includes the authenticity token using prototype and the pug automatic shows how to do the same using jQuery.

Ben Curtis has a tutorial on how to do drag and drop sorting with jQuery and Rails.

Yehuda Katz has a year old presentation on jQuery and Rails that is still worth a look.

Nutrun has a more full post on how to do unobtrusive ajax with jQuery and Rails

ErrTheBlog (errtheblog is dead. long live errtheblog!) gave jQuery some serious love a while back in their jSkinny article. Chris also created a plugin named Facebox that is used extensively on GitHub and has a short post that shows how to get jQuery working with respond_to.

If you are a fan of Low Pro, Dan Webb has created a port of Low Pro for jQuery. (article #1, article #2)

In some Rails Rumble observations, it was noted that jQuery was more widely used than Prototype.

Don’t forget that “jQuery UI provides abstractions for low-level interaction and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications.” Be sure to check out the demos.

If you are a fan of Twitter, you can follow jQuery for links to articles and such.

Nathan Smith gave a crash course on jQuery that includes a sweet airline seat demo.

jQuery does not come with all of Prototype’s functionality out of the box, but you can usually find a plugin that does what you need if you are too lazy to make something yourself.

Lastly, one of my favorite jQuery resources is Visual jQuery. I found this site a blessing when I was trying to learn jQuery.

Feel free to post your favorite jQuery/Rails resources as a comment below.

Continue reading

Posted in Web Design | Leave a comment

Myth #1: Rails is hard to deploy

(If you don’t want to bother with the history lesson, just skip straight to the answer)

Rails has traveled many different roads to deployment over the past five years. I launched Basecamp on mod_ruby back when I just had 1 application and didn’t care that I then couldn’t run more without them stepping over each other.

Heck, in the early days, you could even run Rails as CGI, if you didn’t have a whole lot of load. We used to do that for development mode as the entire stack would reload between each request.

We then moved on to FCGI. That’s actually still a viable platform. We ran for years on FCGI. But the platform really hadn’t seen active development for a very long time and while things worked, they did seem a bit creaky, and there was too much gotcha-voodoo that you had to get down to run it well.

Then came the Mongrel

Then came Mongrel and the realization that we didn’t need Yet Another Protocol to let application servers and web servers talk together. We could just use HTTP! So packs of Mongrels were thrown behind all sorts of proxies and load balancers.

Today, Mongrel (and it’s ilk of similar Ruby-based web servers such as Thin and Ebb) still the predominate deployment environment. And for many good reasons: It’s stable, it’s versatile, it’s fast.

The paradox of many Good Enough choices

But it’s also a jungle of options. Which web server do you run in front? Do you go with Apache, nginx, or even lighttpd? Do you rely on the built-in proxies of the web server or do you go with something like HAProxy or Pound? How many mongrels do you run behind it? Do you run them under process supervision with monit or god?

There are a lot of perfectly valid, solid answers from those questions. At 37signals, we’ve been running Apache 2.2 with HAProxy against monit-watched Mongrels for a few years. When you’ve decided on which pieces to use, it’s actually not a big deal to set it up.

But the availability of all these pieces that all seem to have their valid arguments lead to a paradox of choice. When you’re done creating your Rails application, I can absolutely understand why you don’t also want to become an expert on the pros and cons of web servers, proxies, load balancers, and process watchers.

And I think that’s where this myth has its primary roots. The abundance of many Good Enough choices. The lack of a singular answer to How To Deploy Rails. No ifs, no buts, no “it depends”.

The one-piece solution with Phusion Passenger

That’s why I was so incredibly happy to see the Phusion team come out of nowhere earlier this year with Passenger (aka mod_rails). A single free, open source module for Apache that brought mod_php-like ease of deployment to Rails.

Once you’ve completed the incredibly simple installation, you get an Apache that acts as both web server, load balancer, application server and process watcher. You simply drop in your application and touch tmp/restart.txt when you want to bounce it and bam, you’re up and running.

But somehow the message of Passenger has been a little slow to sink in. There’s already a ton of big sites running off it. Including Shopify, MTV, Geni, Yammer, and we’ll be moving over first Ta-da List shortly, then hopefully the rest of the 37signals suite quickly thereafter.

So while there are still reasons to run your own custom multi-tier setup of manually configured pieces, just like there are people shying away from mod_php for their particulars, I think we’ve finally settled on a default answer. Something that doesn’t require you to really think about the first deployment of your Rails application. Something that just works out of the box. Even if that box is a shared host!

In conclusion, Rails is no longer hard to deploy. Phusion Passenger has made it ridiculously easy.

Continue reading

Posted in Web Design | Leave a comment

WordPress Easy Paypal Payment or Donation Accept Plugin | Tips and Tricks

‘Wordpress Easy Paypal Payment or Donation Accept Plugin’ is an easy to use Wordpress plugin to Accept Paypal payment for a service or a product or Donation in one click. Can be used in the sidebar, posts and pages. Continue reading

Posted in Bookmarks, wordpress | Tagged , , , , | Comments Off

PaperClip: An Alternative Attachment / File Upload Plugin for Rails

redpaperclip.png In Goodbye attachment_fu, hello Paperclip, The Web Fellas present a walkthrough of Paperclip, a new(ish) Rails plugin that makes file (and particularly image) uploads easy. It's well worth a read, especially if you're just starting to develop a new app and are looking at which file upload technique to go with.

Paperclip is compelling firstly because it's developed by thoughbot, a team of ridiculously talented Rails developers who've released a lot of awesome Rails-related projects (such as Shoulda, Factory Girl, and Jester). Secondly, it offers some awesome features: no extra database tables needed to refer to files/attachments, only one library required for image processing (ImageMagick), and a very easy way to refer to files (as attributes on the main model, basically).

The official documentation is here, but Jim Neath has also written a full Paperclip tutorial that will take you from start to finish.

Supported by Media72 Hosting: Looking for reliable UK Ruby on Rails hosting? Packages start from just £7/month on our mod_rails/apache stack hosted on fast UK servers and include free 24/7 support.

Continue reading

Posted in Web Design | Leave a comment