Author Archives: sandipransing

About sandipransing

Web Developer #ruby #rails #JS

Authorize Net (AIM) payment integration with rails

Authorize Net (AIM) method enables internet merchants to accept online payments via credit card. We shall see how to integrate authorize net payment gateway inside a rails app to accept online payments using activemerchant library. Register for authorize net sandbox account … Continue reading

Posted in Ruby on Rails | 3 Comments

Setup Active Scaffold with rails 3 using jQuery

Create new rails project Add active_scaffold gem to bundler Setup active scaffold to use jQuery Generate active scaffold for resource city & zone Add Associations Migrate database Start Server Visit Browser URL: http://localhost:3000/cities Snap

Posted in Ruby on Rails, Tutorials | Tagged , | 3 Comments

Ghostype input Placeholder for search text fields using jQuery

>Placeholder Demo Ghostpe Demo $(document).ready(function(){ var search = “#home-search”; var chars = $(search).attr(‘placeholder’).split(”); $.each(chars, function(i, v){ setTimeout(function() { $(search).val((chars.slice(0, i+1).join(”))); }, 100*i); }); });jQuery placeholder plugin can be used to display default text inside input text fields.HTML5 introduced type search … Continue reading

Posted in Ruby on Rails | Tagged , | Leave a comment

Setting up nginx maximum upload size

>Edit nginx configuration and look for html block.Inside html block add following line.http { include conf/mime.types; default_type application/octet-stream; client_max_body_size 10m; ….}In above configuration “application/octet-stream” supports any kind of file upload.

Posted in Ruby | Tagged | Leave a comment

Twitter share and facebook like button for haml-rails, html/erb

>Twitter share and facebook like button for html/erb<div class=’spread’>  <div class=’twshare left’>   <a href=”http://twitter.com/share&#8221; class=”twitter-share-button” data-count=”horizontal” data-via=”funonrails”>Tweet</a><script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script&gt;  </div>  <script src=”http://connect.facebook.net/en_US/all.js#xfbml=1″></script><fb:like href=”” layout=”button_count” show_faces=”false” width=”450″ font=””></fb:like></div>Twitter share and facebook like button for haml.spread .twshare.left %a.twitter-share-button.left{“data-count” => “horizontal”, “data-via” … Continue reading

Posted in Ruby on Rails | Tagged , , | 4 Comments

number to indian currency helper for rails with WebRupee

>rails has built in number_to_currency helper which takes options like unit, delimeter, seperator which displays foreign currency correctly but somehow it is not best suited for indian currency.Below is how we managed 2 years ago to display indian currency formatted … Continue reading

Posted in Ruby on Rails | Tagged | Leave a comment

Accessing View Helpers & Routes in Rails Console, Rake Tasks and Mailers

> While looking for accessing rails template tags to be accessed on rails console in order to examine whatever written needs to be correct, found that – rails template tags can be tested on rails console using helper objectmodule ApplicationHelper … Continue reading

Posted in Ruby on Rails | 2 Comments