Sunday, December 30, 2012

Using requirejs with backbonejs (Rails)

So, after fighting with it for hours, finally I got it working so I thought it might help someone. I will got through step by step

1 - Create a new Rails application and set it up so that it loads an empty index page
     (Create a controller with an index action + add an index view + edit the routes file accordingly)

2 - Add the following line to the Gemfile - gem 'requirejs-rails'

3 - In application.html.erb file, replace
     <%= javascript_include_tag "application" %> with <%= requirejs_include_tag "application" %>

4 - Add a requirejs.yml file under config directory and delete all the content of application.js

5 - In the vendor/assets/javascripts directory, add backbone.js, underscore.js and JQuery libraries

6 - Add the code as shown below to the corresponding files

7 - Credit goes to -

8 - Thanks

Wednesday, June 20, 2012

Posting code to Blogger using - GitHub Gists :)

1. Add a gist to your git hub account
2. Get the embed link by clicking on the embed button or show embed. (See next line )
    Embed All Files: show embed
3. Copy the script and paste it in your blog
4. Enable "Interpret typed HTML" under Post settings -->Options -->Interpret typed HTML
5. And wallah !!

Ruby on Rails - Downloading data as xls or excel without using a Gem

Awesome !! Thanks Google

A free blog ... with the name of my choice ... no maintenance cost ... nothing ...