Archive

Archive for the ‘ruby on rails’ Category

http_status_exceptions plugin in ruby on rails

September 25th, 2008

http_status_exceptions is a simple plugin to enable the use of exceptions to generate responses with different HTTP status codes.

This can be used to cleanup your controller in handling edge-cases.
For instance, you could raise a HTTPStatus::Forbidden exception if the user is not authorized to perform restricted action, or you could raise a HTTPStatus::PaymentRequired if the user should renew its membership to your website. By default, this plugin will send an empty response with the desired HTTP status code. It is possible to respond with a customized error page as well. In the case of HTTPStatus::PaymentRequired, a response with a credit card payment form can be used, so that the user easily can renew his membership.
Read more…

Share This Post

ruby on rails , , , , ,

Handle multiple attachments in ruby on rails

September 19th, 2008

Creating intuitive interfaces can be challenging, particularly when it comes to uploading files such as images or attachments. Suppose that we are creating an application that let’s someone submit a blog post, to which they can add multiple attachments.

Read more…

Share This Post

ruby on rails , , , ,

HTML / CSS to PDF using Ruby on Rails

September 12th, 2008

Ever tried to save a web page and send it to someone? What about printing a web page? Both pretty much suck.

A lot of people are talking about printing with HTML and CSS these days but what they don’t tell you is the following:

Read more…

Share This Post

ruby on rails , , , ,