Archive for January, 2009

Div inside a p : Invalid HTML

I was trying to center an element using the p tag. Like :
<p style="margin-left:auto; magin-right:auto; width: 50 em;">
<%= show_simple_captcha %>
</p>

show_simple_captcha is a helper method from the simple captcha rails plugin. This view helper generates a div which helps in captcha validation. Now, this created a problem. This piece of code started to behave randomly in IE. Even the source generated in Firefox is invalid HTML. After much scratching arnd, I found that <div> tags are not allowed inside <p> tags. Strange !! I dont have a reason of the top of my head as to why this is disallowed, but this is invalid W3C HTML.

Leave a Comment

action_mailer_tls and Ruby 1.8.7

If you are using action_mailer_tls rails pluin and you shifted to Ruby 1.8.7, your app might break. I recently ran into this problem, coz my host providers shifted to Ruby 1.8.7 and I started getting errors when I was trying to send emails. The problem is because the check_auth_args function has changed in Ruby 1.8.7. Now it requires only 2 args as opposed to 3. The action_mailer_tls plugin uses this function but uses three arguments. So, to get back running again, make the following changes:

1).  Go to your action_mailer_tls plugin installation
2). Inside the do_start function, replace the call to "check_auth_args" with the following snippet:

 
no_args = method(:check_auth_args).arity
if no_args == 2
  check_auth_args user, secret if user or secret
else
  check_auth_args user, secret, authtype if user or secret
end
 

Comments (3)