Christmas Nugget
December 25th, 2006 -
If you haven’t read my article about my edge Rails script or read a very similiar article on the Ruby Advent Calendar then you might want to take a look at this.
Tags: rails 101
Files outside Public Directory
December 17th, 2006 -
A current project I am working on, actually two projects, require files to be protected. To do so, you need to keep the files outside of the public directory, yet allow your users, if they have permission to be able to have access to those files when they so desire. You could use a redirect in an htaccess file, but then how Rubyish is that.
I’ve grown accustomed to using File Column, but I don’t like having to use form_tag in forms as the unhacked way of using it. So, lately I have been using Rick Olson’s Acts as Attachment plugin for all my file upload needs and I have to say I am quite impressed with it.
In this mini article, I’ll show you how I’m currently using it to store files outside the public directory, yet still allow access for users to download those files, if they have permission to access them.
Creating Edge Rails Apps Made Easy
December 10th, 2006 -
Update: I’ve made some updates the the script that I find useful for myself. The script will erase the README file in the root directory of the rails app, create a CHANGELOG file, add screen.css to the public folder, application.rhtml to the app/views/layouts folder, creates the database.yml.sample file in the config folder and edits the database.yml file to the way I like it to be. Calling the script has changed as well: ./set_rails myappname postgres. Basically, myappname is the name of the app and postgres is what database you are going to use for you application. It will set the database.yml file for you. You’ll just need to add your username and password for the database.
I am a huge fan of using edge Rails for all of my development work, when working with Rails. I also have a typical list of plugins I almost always use for my applications that I build. Creating the app on edge Rails, adding all the plugins, and then getting it all setup on subversion can get quite monotonous.
I’ve been wanting to take some time out and write up a bash script (sorry windows people) that will do all of this for me, thus being a painless process. It is DRYing up the process of creating a Rails application on the edge.
Tags: development, rails 101
Creating a static Rails site
August 31st, 2006 -
NOTE – This article has a space between the percentage sign and the greater than sign at the end of the code samples. This is so that it can be rendered correctly in TXP. If you are copy and pasting the code, remove the space between these two symbols.
I was recently asked how one could use Rails to create a static site, so that later, they could then change it to be dynamic or parts thereof to be dynamic. Even though Rails isn’t designed for this, it can be done quite easily.