Following is the Regular expression which accepts numbers, plus (+), miuns (-) symols and skips alphabets,
RegEx: /\A[+\-0-9]+\z/
This RegEx can be useful for Phone number validation.
Posted by firstruby on February 20, 2011
Following is the Regular expression which accepts numbers, plus (+), miuns (-) symols and skips alphabets,
RegEx: /\A[+\-0-9]+\z/
This RegEx can be useful for Phone number validation.
Posted in Useful Links | Tagged: rails, RegEx | Leave a Comment »
Posted by firstruby on February 2, 2011
If you want to call helper method from ActionMailer view in Ruby on Rails (RoR) application, you need to include helper (module) in Mailer file as,
If Helper module name is “UserHelper”, then need to write following in Mailer file,
add_template_helper(UserHelper)
After this, you will be able to access all the methods written in UserHelper in ActionMailer views.
Hope this is helpful.
Posted in Useful Links | Tagged: actionmailer, helper, module, rails | Leave a Comment »