Making small changes to an existing website presents its own unique challenges, as ideally you’d like to change only what is absolutely necessary. When the previous builders have used their own CMS, and Javascript which was automatically generated by a Macromedia/Adobe product (oh, yes), not to mention a little flash thrown in for good measure, it can amount to basically reading pages of code to figure out what’s going on before you do anything.
In this case, when all was said and done, we had a Javascript dropdown menu which dropped over a little design element that had been done in flash. Problem was, the Flash always wanted to be overtop of the menu. Setting unreasonably high z-index properties for the menu elements did not seem to help.
Solution
This may or may not help others, but in this case the secret sauce was to add <param name="wmode" value="transparent"> among the other params, and also to add wmode="transparent" as an attribute in the embed tag for the Flash object.
I think a better solution would be to not use flash in this particular place — but I’m not really interested in fighting that battle this time.
I’m in the process of working my way through the “Rails Routing From the Inside Out” guide at RailsGuts.com. I’m not all the way through the document, yet, but so far it looks like the best such document I’ve seen, short of reading the code yourself with someone holding your hand as you do so. In fact, there is a fair bit of the more informative bits of the Rails source code sprinkled into the guide, so the image of someone guiding you through the Rails source is not too far off the mark.
The site also includes a walkthrough of the Rails initialization process, which looks very informative, as well.
—–
Also interesting is Blank, a starter Rails-app along the lines of Bort, but assuming use of shoulda rather than RSpec, among other things.
Well, Jason Calcanis has written something about startups and the economy.
One of his suggestions is that if your company doesn’t currently have a revenue stream, it needs to get one, like yesterday. Or at least by Monday.
I propose a Rails plugin, which we will call acts_as_monetized. It will automatically track your new users, and after a 30-day trial period will stop letting them use any models which include act_as_monetized until they start paying you.
The age old formula will now be:
- Create application.
script/plugin install acts_as_monetized
- Profit!
You’re welcome.
(Building something people are willing pay you for will not be included in the plugin.)
Say you have an array. Maybe it is ["Larry", "Moe", "Curly"]. You’d like to display this as a sentence, not just a join, so it would read "Larry, Moe and Curly". That would be nice. Of course, you can’t guarantee that your array will have three items. Maybe tomorrow it will be just ["Frodo"], or ["Groucho", "Chico", "Harpo", "Zeppo"].
No problem. Let’s say your array is list. You could write:
1
2
| list.size > 1 ? "#{list[0..(list.size - 2)].join(', ')} \
and #{list.last}" : "#{list.first}" |