Learned the hard way...
When you’re setting up logins in Rails, the tutorials tell you to store action_name
and controller_name
in the session so you can redirect there later… Capture request.path
instead. This works just fine:
redirect_to :controller => session['intended_controller'], :action => session['intended_action']
…until you’re using restful resources and a logged-out user clicks an edit link. When Rails tries to take them to “/entries/edit” (controller followed by action) instead of “/entries/1/edit”, it’ll bomb:
ActiveRecord::RecordNotFound in EntriesController#show Couldn't find Entry with ID=edit
So this is better:
redirect_to session['intended_path'] #request.path stored earlier
Oh, and when they say to put this in your ApplicationController
:
before_filter :authenticate, :authorize, :except => [:login]
Do this instead:
before_filter :authenticate, :authorize
…and then put this in specific Controllers where you need the exception:
skip_before_filter :authenticate, :authorize, :only => [:login, :verify]
Was fidgeting with my wedding ring this morning when I felt an odd bump on it; looked down to see a lovely little scratch in the gold. Had to stop for a minute and think how it could have gotten there…
That’s when I realized that wearing it through the Lava River Cave was probably not the smartest thing I’ve ever done. It’s the easiest cave imaginable short of going in and paving a walkway, but I was propping my hand (and therefore the ring) on the walls, floor and ceiling pretty much the whole time. (The alternative was slipping and cracking my head open.)
Oh, well, I’m sure a jeweler can get the ring back to like-new condition. I need to think about the fact that I’m wearing it more often, though.
We made it all the way to the end of the cave, by the way, even Lenny. (I think he had an easier time than I did, in fact.)
Read more...Sweeeeet...
$ ruby %scripts%\xbox_live_alert.rb nephariuz frejya I, [2008-08-21T21:16:22.343000 #1968] INFO -- #Utility::Email::Email:0x793e340: @body="nephariuz\tXbox 360 Dashboard\nfrejya\tXbox 360 Dashboard", @recipients=["me@wirelesscarrier.com"] ...
Thanks to a Live status feed someone published and a quick REXML script, I can get a text message whenever two or more friends are online, along with what they’re playing…
Read more...Great… The heartburn is kicking in again.
I’m not really stressed, just a bit depressed. Wasn’t I blogging something along these lines last fall? I need to go back and read.
Edit:
Okay, I think I’m seeing a pattern here…
2007-08-15:
I've got that burning, aching melancholy again. It's like the calm before a storm. It's not even about the baby... I think this happens to me every fall.
2007-08-15:
My heartburn's starting again. I know it's not triggered by weight, because I just came off a diet. Must be stress, then (and I have no shortage of that).
2006-09-05:
Ah, that's why I've been in such a blue mood lately! I forgot to listen to The Campfire Headphase for, like, a whole month!
Clearly, I need to just spend the months of August and September in bed from now on.
Read more...Thank you for my sincere apologies have a nice day.
The Dell Inspiron laptop (“Mini-me”) has been sending phantom keystrokes since we got it… It doesn’t interfere with ordinary document editing, but it renders Alt-Tab useless, makes new windows pop to the back of the stack, and plays havoc with context menus. It wasn’t bad enough to return it immediately, but it’s driving both me and Diana crazy. I don’t have any upcoming presentations now, so it’s finally time to send it in for repair.
Of course, first I have to get past “Lalit” with tech support. Her first action was to point me to a Microsoft Knowledge Base article on System Restore. Here was my terse response:
> This is a hardware problem, not software. I'm certain of this because > I was able to reproduce the issue on a live Linux distribution (i.e. > without Windows running). > > Sorry, but performing a system restore won't help. Please make > arrangements for us to return the system for repairs.
Sitting in my e-mail this morning was a request for an address to ship the return box to.
I’ve done my time listening to muzak while on hold for techs who don’t know their systems half as well as I do; I’m through messing around.
Read more...