Archive for April, 2007

Cool Minimalistic Site Design

Sunday, April 22nd, 2007

I just recently got Eric Allam to give me his blog URL, and I love his site design at last100meters. In trying to come up with a design for the project I’m working on, my aim is to strike a balance between minimalism and a flashy web 2.0 look, while still being unique and useful UI-wise.

Eric’s site definitely appeals to the minimalist in me though, and is the first that I’ve liked a lot since Google’s homepage. The posts/titles are big, prominent, and pure text, spanning the whole left pane down the page. Three links, the RSS feed, Google Reader shares, and Twitter feed are the only things with images, even then being tiny. White space is everywhere, and his contact information is immediately available. I love it!

In contrast, you can tell from my blog design that I like to just take everything I have ever touched and throw it all together… now that’s art =p

Multiple Blogs Are Not For Me

Sunday, April 22nd, 2007

Whether or not to commit to other blogs has been bothering me for a while now. I started with this blog… When I had a job at New Media (seems their site is down right now, how ironic =), I was assigned another blogging account. It started there, I had to make decisions between what I considered better suited for my personal blog or my work blog. This type of thing is especially hard for a web developer, as the divide between personal and work related activities is hazy at best.

I never ended up using that account, and didn’t post here either because of never knowing where to post. Later, I was offered to blog Ruby and Rails specific stuff with the guys at Rails Envy. Although they are both great dudes whom I respect, for some reason I couldn’t get myself to say yes.

We were also thinking about how it might be cool to have a Rails/Ruby dev blog for PayPerPost. You know, get a bunch of developers all blogging in the same place about cool stuff we come up with daily. Yet again, that would mean splitting content between this blog and another (can you see what I mean about a developers work/play divide being slim?)

Just today I was asked whether I wanted to be apart of a neat idea for a Ruby blog with my friend/coworker Eric

As I hinted in my last post and my latest rockstartup confessional (doesn’t seem to be online yet, wait for it!), I am spending my spare time working on an awesome site to help people blog more (solving my own problems here, heh) and pump quality content into the web via microformats. Of course, I have to be cool and make a company blog for that, right?

Nope, I say all this worry and frustration ends here. I am making the decision now to devote all my time and effort blogging to this site. No more distractions, no more stress, and much more learning and content. I’m not sure if I’m the only one running into this problem, but if you felt anything like dejavu reading this I invite you to do the same.

Beast Source Code Snippet

Wednesday, April 18th, 2007

I downloaded and browsed the source code for the Beast forum today. Because it’s REST’ful, open source, and developed by Rick Olson, I recommend any Rails developer to look at it. What makes it even better is that a goal of Beast is to “stay around 500 lines”, meaning the app doesn’t take much time to figure out and can be studied leisurely.

Anything you define in YourController#rescue_action will be run when an error is raised, so check out what I found in Beast:

def rescue_action(exception)
exception.is_a?(ActiveRecord::RecordInvalid) ? render_invalid_record(exception.record) : super
end

def render_invalid_record(record)
render :action => (record.new_record? ? ‘new’ : ‘edit’)
end

As you can see, now any errors that are invalid AR objects will call a special method. This method render’s new or edit depending on whether the record exists yet or not.

So…rather than doing this in our controllers:

def create
@record = Record.new(params[:record])
if @record.save
flash[:notice] = ‘Saved successfully’
redirect_to :action => ‘index’
else
render :action => ‘new’
end
end

We simply do this:

def create
@record = Record.new(params[:record])
@record.save! and flash[:notice]=(’Saved successfully’) and redirect_to(:action => ‘index’)
end

The magic is in the save! method, as the “bang” raises errors instead of returning false when validation fails, not bad!

On another note, I’ve been spending a lot of my time recently on reading books about and developing a social site… As you know, my ambition to blog a lot since the creation of larrytheliquid.com has quickly diminished. I’m making this app to change that for myself and all bloggers… but that’s enough for now =)