Prev PageNext Page
How to Use Pretty URLs with Rails will_paginate Plugin
The will_paginate plugin for Rails uses a key/value assignment like ?page=2, rather than the pretty url formats such as /page/2 ... This is because url generation and mapping are handled by the routes.rb file. You'll need to modify the file so that rails ...
Written by Sean Behan on 06/17/2012
more of hessian
Written by Sean Behan on 06/17/2012
hessian
Written by Sean Behan on 06/17/2012
Rails: Expiring a cached page with namespaces and sweepers
I've got some pages that are cached using their permalinks on the filesystem, such as http://example.com/about-us.html which will need to map to RAILS_ROOT/public/about-us.html ... The issue I have is that I use a namespace for the admin area and the cont...
Written by Sean Behan on 06/17/2012
Dot htaccess file for wordpress installation (.htaccess)
Login to your wordpress installation and scroll to and click the second to last link set "Settings". You'll need to configure wordpress to handle your new links as "permalinks". Make a selection and copy the code into your .htaccess file. Wordpress will a...
Written by Sean Behan on 06/17/2012
Using Your Partials in Your Liquid Templates
I'm working on a project that requires users/designers be allowed to edit the layout of their site. I'm using Liquid, Ruby templating system developed by the folks at shopify.com. Doing a little searching I found this great post http://giantrobots.though...
Written by Sean Behan on 06/17/2012
Custom Date Formats for Your Rails Application
If you use a consistent date format often in your Rails applciation, it is worth it to add the format to your application environment. You can do this by adding  it to the bottom of the config/environment.rb file. Time::DATE_FORMATS[:my_custom_format] ...
Written by Sean Behan on 06/17/2012
Sending eMail with Rails on Mac OS X Development Environment
You'll need a mail transport agent (MTA). I installed and used postfix using Mac Ports. sudo port install postfix You'll need to start postfix, to send mail from your Rails application. You can set it as a startup item and it will start on boot. However...
Written by Sean Behan on 06/17/2012
Quick Syntax to Pipe an SQL Query Directly to a file
Here is a quick way to put the contents of a database table into a simple text file. This could be handy if for example, you just want to grab some emails and pop the results into a simple csv file. Your sql statement can be as creative as sql allows. All...
Written by Sean Behan on 06/17/2012
Rails Migrations and Auto Incrementing Migration Prefix Number
In your environment.rb file turn off timestamped migrations like so: config.active_record.timestamped_migrations = false
Written by Sean Behan on 06/17/2012
Prev PageNext Page