Importing CSV and Excel in rails 4 and ruby 2.0

You can use a single gem ‘roo’ for reading all types of file, instead of rubyXL, spreadsheet etc. multiple gems for different files(.xls, .xlsx). You can check here railscasts for importing csv and excel import in ruby 1.9.3. But this code snippet is not working with Ruby 2.0. As this episode used gem ‘roo’ for reading files and gem ‘roo’ has been updated…

Things which Rails could do but I didn’t know.

Run Helper methods in the console $rails c => helper.number_to_currency(100) => “$100.00” => helper.time_ago_in_words(3.days.ago) => “3 days” Shorthand Migrations $ rails g resource person first_name:string last_name:string email:string token:string You can write above command as- $ rails g resource person first_name last_name email token Both will generate same migration: class CreatePeople < ActiveRecord::Migration def change create_table…