WebOnRails

Its all about Ruby On Rails

Follow me on TwitterRSS Feeds

  • Home
  • About
  • Contact

Jquery Full Calendar with RubyOnRails

Mar 29th

Posted by Akhil Bansal in ROR

5 comments


Cross Posted from http://vinsol.com/blog

Contrary to popular belief, working on a client project gives us a generous margin of creativity and explore innovative solutions.Take the example of a recent project I was working on. The client required a collaboration-based calendar module for their application similar to Google Calendar. Initially we started developing it from scratch , but then, we found an awesome Jquery plugin.

“FullCalendar” provides a full-sized, drag & drop calendar. It uses AJAX to fetch events on-the-fly for each month. It also supports an intuitive interface to manage events that spans over multiple days or weeks. It is visually customizable and exposes hooks for user-triggered events (like clicking or dragging an event).


I decided to give it a try and utilize its hooks for user triggered events within our Rails application. This small effort resulted in a barebone Rails app that might provide a good base for your project which require calendar, scheduling or appointment features. I called it fullcalendar_rails and it is now available on github with a working demo at http://fullcalendar.vinsol.com.



Update: Added recurring events functionality to the demo app.


Feel free to give your valuable feedback. I hope you will find this useful.


calendar, jQuery, Rails, ROR, Rubyonrails, Tips, Trick

11 Things to Consider Before Deploying Your Rails Application

Nov 16th

Posted by Akhil Bansal in ROR

2 comments


Cross Posted from http://vinsol.com/blog

At VinSol, we have been developing and deploying Rails applications for more than four years. During this period, we have identified some best practices that we prefer to follow while deploying rails application to production server.

Below is the checklist of these practices:

 

1. Ensure that NS records and MX records are changed if they need to be changed

Changing nameservers will point the domain to the hosting server, and changing MX records will redirect incoming mails to the mail server. As a very first step, we should make sure that name servers of the domain are set to be the correct one. Changing MX record is a must if our application is parsing incoming mails or we wants to use other mail services for e-mail exchange, for example Gmail.

 

2. Ensure some backup mechanism in place for both data as well as user uploaded content like images/documents etc.

Since production data is very critical, we must setup backup mechanism. It could be some type of scheduled task that takes periodic backup of all critical data, Or it could be some type of backup service provided by hosting company. When we talk about critical production data, it includes production DB, content generated by application users like images, documents, etc.

 

3. Ensure database indexes

We might have done development without having proper database indexes, but we should avoid going to production without them. Adding indexes might slow down insert queries a bit but it increases the performance of read queries. It applies when application in production has percentage of read operations much more than write operations.

 

4. Enable your slow query log

This is specific to MySQL. Enabling slow query log allows MySQL to log slow running queries to a file. And this log can be used to find queries that take a long time to execute and are therefore candidates for optimization.

 

5. Ensure exception capturing is in place

We might want to be notified when something bad happens to our application. There are several hosted services available who receive and track exceptions, for example Hoptoadapp.com, GetExceptional.com etc… Either we can choose one from these hosted services or we can use “exception notifier” plugin.

 

6. Ensure adding entries for cron/scheduled jobs

Most of the applications have some functionality/jobs that need to be run periodically, for example generating invoices, sending newsletters etc. In most cases these jobs are done by a rake task. We should make sure that we have added such jobs to cron or similar program.

 

7. Monitoring important processes

To ensure that our site is up 24×7 we need to ensure that all processes that our application needs are up. There can be many processes like MySQL, Mongrel, Apache etc.. These processes are very important as our application directly depends on them. For example if MySQL process get killed accidentally, our application would not be able to connect to MySQL and will start throwing exceptions.

We can choose any of the available monitoring tools like God, Monit, 24×7 etc…

 

8. Ensure confidential data filtering

We would never like to leak/share confidential information of our application users. We should make sure that none of the user’s confidential data like SSN, Credit card info, password are being written to log files. We might not have paid much attention on this while developing the application.

 

9. Rotate log files

Once our site is up and running, every single request write some text in log file. And hence size of the log file keeps on increasing. Larger log files can put us in trouble if we get it beyond certain size. Its difficult to manage these log files, as larger files need more memory to open and need more time to download. In one of the rescue project we did , the log file size was 3GB.

We would recommend having logrotate setup for the application.

 

10. Setup Asset Host

Setting up asset hosts can reduce loading time by 50% or more. We must setup asset hosts for our application. Once asset hosts are all set, our static files will be delivered via asset hosts for example asset1.hostname.com, asset2.hostname.com

 

11. Clearing up stale sessions

We should make sure we should not left any stale session on the server. If our application is using DB or file system as session store, we must add a schedule task to delete stale sessions.

These are some of the points we have identified from our past experience and we might be missing some. Feel free to always add them as comments, and I’ll keep this post updated.


Akhil is a senior software engineer working with Vinsol for last 5 years. He is an inhouse deployment ninja.

 

 

We also provide affordable rails deployment services.

 

 

deploy, deployment, Rails, ROR, Rubyonrails, server, Tips

Displaying information about your git repository

Nov 12th

Posted by Akhil Bansal in Rails

1 comment

Want to see information about your git repository?

Based on a discussion here Duane Johnson wrote a very useful bash script. I am using this script from months and would like to share with you. You can download this script here(git-info.txt (483)).

You can also add an alias like below, so that I can be a accessed by a single command “gitinfo”

alias gitinfo="/home/akhil/git-info.txt"

When you run this script from your working copy it displays:

  • Remote URL
  • Remote Branches
  • Local Branches
  • Configuration (.git/config)
  • Most Recent Commit

Isn’t it useful, give it a try ;-)

bash, git, Rails, ROR, ruby, Rubyonrails, Tips, tricks

Change timezone of ubuntu machine from command line

Jul 15th

Posted by Akhil Bansal in bash

9 comments

If you guys want to change timezone of your ubuntu machine then you can do it by issuing:

dpkg-reconfigure tzdata

This may be helpful if you deal with servers.

hosting, server, Tips, Trick, tricks, ubuntu

Multiple versions of ruby on ubuntu

Jun 23rd

Posted by Akhil Bansal in ROR

1 comment

Three-Four days ago I was in a situation where I need to have multiple versions of ruby and rubygems on my ubuntu machine. I was lucky, I found an awesome article http://blog.michaelgreenly.com/2008/08/multiple-versions-of-ruby-on-ubuntu-2.html. This really solved my problem, Many thanks to Michael Greenly.

linux, Rails, rails_plugin, ruby, Rubyonrails, Tips, tricks, ubuntu
«12345»1020...Last »
    • Recent comments
    • Popular posts
    • Archives
    • Tags
    apache attachment_fu bash capistrano deploy edge rails Error event Exception Exception Handelling full text search funday gems git hosting image installation instance leopard mod_rewrite Notification pound Rails rails_plugin redirect rewrite ROR ruby ruby event rubygems Rubyonrails SCP script SEO server sftp STI terminate Tips transfer Trick tricks ubuntu Ultrasphinx wordpress
    • July 2010 (1)
    • May 2010 (2)
    • April 2010 (2)
    • March 2010 (1)
    • November 2009 (2)
    • July 2009 (1)
    • June 2009 (1)
    • May 2009 (1)
    • March 2009 (1)
    • February 2009 (6)
    • January 2009 (3)
    • December 2008 (6)
    • November 2008 (7)
    • October 2008 (3)
    • August 2008 (5)
    • July 2008 (1)
    • April 2008 (2)
    • February 2008 (1)
    • January 2008 (3)
    • December 2007 (1)
    • November 2007 (2)
    • October 2007 (1)
    • September 2007 (3)
    • August 2007 (2)
    • July 2007 (3)
    • June 2007 (1)
    • May 2007 (2)
    • April 2007 (3)
    • March 2007 (1)
    • February 2007 (4)
    • January 2007 (2)
    • December 2006 (6)
    • November 2006 (7)
    • October 2006 (4)
    • September 2006 (4)
    • August 2006 (4)
    • July 2006 (5)
    • June 2006 (9)
    • Plugin: state_select, generate drop down selection box for states (41)
    • Acts_as_solr: Starting solr server on windows (25)
    • My new HP Pavillion DV2117 Notebook (16)
    • Accessing session data using session_id (11)
    • Bash script for creating new rails project and initial SVN import (with ignoring/removing log/other files) (10)
    • Careful while using Exception Notifier Plugin (10)
    • apache proxy balancer + mongrel clusters and deploying application with capistrano (9)
    • Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff (9)
    • Change timezone of ubuntu machine from command line (9)
    • Migration: Adding/Removing columns are now much easier (8)
    • Shawn: The original link does not work, but I found it in the following location:...
    • kevin: you'll want to make sure the lang attribute is sanitized as well, obviously
    • kevin: you shouldn't use spelling.rb, as it will open your site to hacking (very easily). make a tempfile...
    • Prashant: Thanku sir
    • lantjie: hey, it help me thanks
    • Tweets that mention Edge Rails: Time#current | WebOnRails -- Topsy.com: [...] This post was mentioned on Twitter by Akhil Bansal, Rails Bot. Rails Bot said: Edge Rails:...
    • taelor: protip: If your website deals heavily with different Time Zones, you need to use...
    • Louboutin shoes: I am the first time on this site and am really enthusiastic about and so many good articles. I...
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top