Send email from application via postmark

Postmark is widely used email delivery service for the web application. The “Postmark-Rails” Gem is a drop-in plug-in for ActionMailer to send emails via Postmark. Links: Postmark-app , Postmark-rails gem , Postmark Developer’s Blog To integrate it with your application: 1. Create an account on postmark.com (it also provides free account), set your-email as sender’s signature. This email-signature only you…

Heroku – How to Setup on local

To Setup Heroku on local machine we first need to add the heroku gem using, gem install heroku then we need to add heroku plugins using, heroku plugins:install git://github.com/ddollar/heroku-accounts.git we then need to add heroku account using, heroku accounts:add project –auto where “project” can be any name that’s meaningful to you, the name is only…

Avoid rails helper times_ago_in_words()

Let’s say we have 100 records in lessons table then %td.last_modified= times_ago_in_words(lesson.updated_at) server calculate the time ago for each record for each request, it wastes a lot of time on server side. If we replace above code by %td.last_modified”= lesson.updated_at.to_s and load jquery plugin  <script src=”jquery.timeago.js” type=”text/javascript”></script> then in JavaScript $(“td.last_modified”).timeago() thats it. Then the…

Reload or Add routes at runtime in Rails 3

In one of my project, we needed SEO friendly Menu urls like /brandy/cognac. For this, we added a generic route/:parent/:child/:grandchild at the bottom of routes.rb. With this approach, there was an issue with invalid urls like /this/is/wrong being redirected to specified controller action. To fix this, we used Menu names to generate specific urls. But the routes would become invalid if Admin…

jquery ketchup-plugin for Client-side form-validation:

jquery ketchup-plugin for Client-side form-validation: There are many jquery plugins available for client-side form validation (to validate form before actually submitting it). jquery ketchup-plugin is one of them. Github: https://github.com/mustardamus/ketchup-plugin Demo: http://demos.usejquery.com/ketchup-plugin/ Validations provided by plugin: https://github.com/mustardamus/ketchup-plugin/blob/master/jquery.ketchup.validations.js Steps: 1. include css file in your application.css file *= require jquery.ketchup 2. include js file in your…