Posted by Randy
on September 24, 2008
I have decided to take a stab at using squidoo effectively, while promoting a clickbank product to hopefully make some sales. I was over at potpiegirl.com and her posts really inspired me to try harder. I contacted her and asked her for some tips, which she gladly helped out with.
I pulled together a squidoo lens, which that in itself can be overwhelming, and came up with a page promoting creating free electricity. I am no expert, so I’m not even sure if what I’m doing will work. Hopefully it works out well!
On a side note, you can follow me on twitter
Posted by Randy
on September 23, 2008
Couldn’t help it, but this made me laugh. Got the same response from co-workers I passed it around to:

Posted by Randy
on September 23, 2008
I had an application that was prompting a HTTP Authentication box in IE after using the restful authentication plugin. The way I fixed it was to replace the access_denied method in lib/authenticated_system.rb to:
def access_denied
respond_to do |format|
format.any do
#format.html do
store_location
redirect_to new_session_path
end
#format.any do
# request_http_basic_authentication 'Web Password'
#end
end
end
Noticed I commented some lines out. This was so that if i ever need to revert, the code will still be there and I wont have to go looking for it. Hope this helps!
Posted by Randy
on September 10, 2008
If you weren’t already aware of this, there IS a difference between using route_url and route_path. Here are what they return:
<%= posts_url %> # => http://localhost:3000/posts
<%= posts_path %> # => /posts
As a general rule of thumb, you would want to use posts_url in your controllers, and posts_path in your views.
Posted by Randy
on September 09, 2008
While this isn’t a ruby on rails specific issue, I do tend to do this a lot, and never thought twice about it, until it starts bugging the crap out of me.
The issue is that you have a link that is used to do some type of javascript, instead of linking. So you add an onclick event, but you need something to link to. I usually put in a # sign:
<a href="#" onclick="dosomething();">Do Something</a>
<%= link_to 'Do Something', '#', :onclick=>'dosomething()' %>
This is great, except that it jumps you to the top of the page. Very annoying. Here is the solution:
<a href="#nogo" onclick="dosomething();">Do Something</a>
<%= link_to 'Do Something', '#nogo', :onclick=>'dosomething()' %>
Notice I added “nogo” to my #. This will help prevent from jumping to the top of the page. You can of course use any text you want there.
Posted by Randy
on September 04, 2008
The guys over at NeverBlock have released a database adapter for Rails application that will severely increase the performance of ActiveRecord. Its also really easy to integrate into your application. Heres how:
Add a line to environment.rb for mongrel or thin servers:
require 'never_block/servers/thin'
or
require 'never_block/servers/mongrel'
Change the adapter in database.yml:
adapter: neverblock_postgresql
or
adapter: neverblock_mysql
You can also specify the number of connections (default of 4):
More information, along with benchmarks, can be found here.