I want to create data by importing excel.
I have got the record of states in excel file and my state model has got only one field state_name.
I want to make a rake task to create all the record of all the states present in the excel file but I don't know how to work with excel.
I have created a basic rake task like this in the lib/tasks:-
namespace :state do
task :create => :environment do
end
end
How do I put the code which will read the excel file and create the states based on that ?