So, what’s the next big thing gonna be? TAG SPAM. That’s right Continue reading →
Entries Tagged 'CMS' ↓
Tag Spam :: The Next Big Thing
October 3rd, 2007 — Beginning Programming, Blogs, CMS, JavaScript, MySQL, MySQL 5, PHP, Perl, Programming, Rails, Ruby, Software, Spam, Web Graphics, WordPress, XHTML
Rails on DreamHost: How to restart your app after a change…
August 23rd, 2007 — Beginning Programming, CMS, DreamHost, Programming, Rails, Ruby, Software
If you, like me, and like so many countless people, host a Rails site on DreamHost, sometimes you need to make a tiny change to the code. (sometimes a BIG change…) But the changes don’t seem to take effect! Well, they how and why about that is pretty heady stuff I won’t go into here, but I will tell you how to restart your app the DreamHost way!
Continue reading →
Simple Rails Routes Catch-all redirect instead of 404
August 23rd, 2007 — Beginning Programming, CMS, Goodbye Helicopter, Programming, Rails, Ruby, Software
Like so many people fairly new to Rails, I encountered the situation where a requested page that doesn’t exist generates the dreaded 404 not found message. (the default Rails message doesn’t actually mention ‘404′ and it should, but that’s a different matter)
The simplest, graceful solution I came up with is this:
Create a route in config/routes.rb that redirects to a ‘catcher’ method in a controller. It doesn’t really matter which controller you use. Just make sure it corresponds to the route you write.
In that controller define a method called ‘catcher’ (or whatever jives with you). The catcher method simple populates the flash[:notice] with a message telling the site visitor that the page requested does not exist and then redirects to the home page.
It’s not the most sophisticated solution, but it does work and keeps the visitor at your site rather than being turned away by a cryptic message they may not understand. This way, they’re more likely to continue browsing your site! This is a good thing, because the average, every-day human who browses a web site is completely confused and disappointed by messages like 404, even though most have seen it at some point. Besides that, such messages make your site look bad to those visitors.
Of course this method could be made more comprehensive. You could include in the controller method, ‘catcher’, additional code to log the requested address and redirection. It may seem silly, and you could probably dump most of the log generated, but if you could determine that legitimate requests were coming in often enough for a particular mis-spelling or simply a particular page or url/uri, then you might want to actually create that page, or at least a route for it.
Here’s the code:
In config/routes.rb …
# This is a catch-all for routes that don't exist, visitor is redirected to home page.
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
map.connect '*path', :controller => 'home', :action => 'catcher'
end
In the corresponding controller (in my case, app/controllers/home_controller.rb)…
def catcher
flash[:notice] = 'Seems that the page you were looking for does not exist, so you\'ve been redirected here.'
redirect_to :action => 'index'
end
Simple Stuff In Rails: You don’t have to use the database for everything!
August 20th, 2007 — Beginning Programming, Blogs, CMS, Programming, Rails, Ruby, Software
Sometimes I find myself creating database tables for something that doesn’t really need to be in a database at all. Think configuration. Say you build a CMS or a blog system of some sort, and then you want some simple data to be accessible without putting in a database. You don’t need all that over head for everything!
So, what to do? This is part of the Mystery of Rails Models! Just create a model. Continue reading →
Rails is Bailing out in RMagick…
July 25th, 2007 — CMS, ImageMagick, Programming, RMagick, Rails, Ruby, Web Graphics
Maybe I’m a fool for putting my RMagick into a Rails controller and not a model. We’ll see, later. After I adjust things a bit and try the model approach.
Here the code as a stand alone script:
# RMagick Test
require 'rubygems'
require 'rmagick'
include Magick
puts "Enter the name of the file to thumb:"
image_to_alter = gets.chomp
img = Image.read(image_to_alter)[0]
thumbnail_height = 100
thumbnail_width = 100
geometry_obj = Geometry.new(thumbnail_width, thumbnail_height, nil, nil, '!')
chg_geom_img = img.change_geometry(geometry_obj) {|cols, rows, image| image.resize(cols, rows)}
chg_geom_img_name = 'thumbnail_' + image_to_alter#@basename_of_f
chg_geom_img.write(chg_geom_img_name)
Here is the original image:

Here is the image after resizing with my Ruby script:
![]()
Here is the version that was resized using almost the identical code, from within a Rails app:
![]()
Screwy, huh?
Any tips/advice very welcome!
Thoughts on BaseCamp
June 22nd, 2007 — CMS, Programming, Rails, Software, Web Graphics, WordPress, XHTML
I started working with some people recently who use BaseCamp. If you don’t know, BaseCamp is one of the pretty impressive things to come from the same people who created Rails. In fact, BaseCamp was one of the reasons for creating Rails to begin with.
Thus far, it’s pretty impressive. It’s responsive and feature-rich. It’s not terribly intuitive at first, but what project tracking/management application is intuitive? Name one. Can’t, can you? Regardless, the interface is pretty good. Similar in some regards to what you see in the WordPress dashboard, but a bit more thought-out.
I’m liking it, but it definitely takes a little getting used to.
Now, if only Google would come this close to good UI for Analytics (what a mess)!!
Interesting WordPress Themes. CLI interactive!
April 30th, 2007 — Blogs, CMS, CSS, JavaScript, Linux, PHP, Rails, Ruby, Software, UNIX, Web Graphics, WordPress, XHTML
Here are a couple of interesting wordpress themes that resemble
unix/linux command line
and
Comodore 64
of course these are done in PHP but I’d like to see these done in Ruby or Rails and perhaps one that looks like irb. Oh wait, _why has already half done that…
Rails By the Slice
April 16th, 2007 — Blogs, CMS, Rails, Review, Ruby
There’s a new (?) hosting service around that focuses on Rails hosting and does it by the slice. Continue reading →
eRUBY: Ruby + XHTML = .rhtml
March 22nd, 2007 — CMS, CSS, PHP, Perl, Rails, Ruby, Software, Uncategorized, XHTML
eRuby means embedded ruby; embedded in xhtml, that is. The result is often a file with the .rhtml extension, Continue reading →
Amazing Rails Framework + Amazing TextMate
March 21st, 2007 — Beginning Programming, Blogs, Books, CMS, PHP, Perl, Rails, Review, Ruby, Software
If you are wondering about Rails and Ruby, stop wondering and dive in. While you’re at it, get a good editor and machine to work with. This means a Mac and TextMate. If you don’t have a Mac already, get one, it’s not the cheapest, but not the most expensive; just the most value for your moollah! Continue reading →