Problems Uploading Files to WordPress?

by Calvin on June 25, 2009

A Google search seems to indicate that problems uploading files on WordPress installs is a pretty common occurrence.  Unfortunately, I had the hardest time finding the solution to my particular ailment.  Hopefully, this post will find those others who run into this problem in the future.

From the WP Admin pages, go to Settings > Miscellaneous.  Make sure the value for ‘Store uploads in this folder’ is where you want your files stored (in most cases, it should be wp-content/uploads).

Miscellaneous Settings ‹ Don’t Forget to Plant It! — WordPress

In my case, this was pointing to a folder I was using for a WP install I was using to test the Thesis theme I’m using now.  Reverting it to the default fixed my problem.

{ 0 comments }

Creating Static Pages w/ Rails ActionViews

by Calvin on May 24, 2009

Recently, I needed to create some static reporting pages for Skribit.  From a quick search, I got a lot of results that talk about Rails and static pages, but none did exactly what I needed:

  1. To be able to generate pages with different paths from one URL
  2. Pages to persist across Rails deployments

Not seeing any solutions that fit my needs, I set out to come up with my own.  Here is what I ended up with.

First, I needed to add a route for generating/displaying the reports:

From here, I could just use the standard caches_page :show declaration, but that would only generate the page I wanted if I used /report/2009/05/25 as the URL.  What if I wanted /report to generate the report for the current week?  Well, you can do something like this:

The magic is in the after_filter method cache_weekly_report.  We basically use the same mechanism Rails page caching uses to save our new report page.  Now, calling /report will generate a static report at /report/2009/05/25, or whatever the current day is.

The last thing to do is to make sure that the reports persist through new server deployments.  That can easily be done with a symlink in your capistrano script:

And that’s it!  What do you think?  I’d love to know if there are any simpler solutions to this.

{ 0 comments }

Building Software to their Audiences

February 24, 2009

When building software, it’s a good idea to identify the needs of 3 different kinds of audiences.
The first 2 kinds are obvious ones.  We know to listen to what our End Users ask for, but not necessarily build everything they ask.  And we want to balance what the Business wants with when they want it.
The [...]

Read the full article →

Turning a New Page

November 15, 2008

It’s been a month now since I left my contract at AutoTrader.com.  For the most part, I’ve enjoyed my time there, but the thought of celebrating my two year anniversary there was a little frightening.  While I am very adaptable to the corporate life, it isn’t for me.  When FlickStation (the last startup I was [...]

Read the full article →

Growl Notifications for Ant

October 18, 2008

It’s a real refreshing change to be doing developing on Mac these days.  Currently, our Ant builds at work are less than optimal, taking ten’s of minutes to do a full build.  Fixing it is something we definitely want to do, but because of the complexity of the build and existing deadlines, right now isn’t [...]

Read the full article →

Moving Off WP.com

October 7, 2008

So after three months of WP.com, I’ve decided to move back to my own hosted WordPress blog.  One reason for the move was so that I can beta test our Skribit widget, which can now be easily styled to blend perfectly to your site.  Please give it a shot, and shoot us any feedback.  Right [...]

Read the full article →

Running FiveRuns TuneUp in a Separate Environment

October 5, 2008

FiveRuns’ TuneUp is a great tool for profiling your Rails app, but by default it is always running in development. This causes two issues 1) every request is slower in development as it is always collecting profiling data, and 2) the TuneUp bar can mess with the layout of your application, especially if you’re [...]

Read the full article →

Aptana Goes into the Clouds

September 7, 2008

I use Aptana for RoR development.  Not because it’s a good Ruby or Rails IDE, but because I do so much Java at my paying job and switching between Java development on Eclipse to RoR development on Aptana is a breeze.  Today, I was checking out Aptana’s website for updates when I noticed that they [...]

Read the full article →

Problems With Rails Fixture Labels?

July 13, 2008

Newer versions of Rails has a nice feature where you can use label references for fixtures. So instead of:
# posts.yml
test_post:
user_id: 1
title: My Test Post

You can do this:
test_post:
user: quentin
title: My Test Post

However, if your model class name is in a pluralized form, you might find that label [...]

Read the full article →

25 Things I Hate about Maven

June 28, 2008

I’ve been doing a lot of work with Maven recently, and having a miserable time of it.  Earlier this week I was ranting about it on a mailing list I was on, when I thought it would be therapeutic to try to list 100 things that irks me about Maven 2 that I’ve personally ran [...]

Read the full article →