Hi
I have a form for importing a csv file. With every entry in my CSV I
do a delayed background call from a webservice and the result is then
saved to my database. This is working great!
Now I tried a CSV file with over 400 rows. After clicking import in my
form it takes some time and then I get the following error message:
''ActionDispatch::Cookies::CookieOverflow''. But nevertheless
300 of the
400 jobs are already created in my delayed_jobs table.
The code below is copied from other threads, so I don''t really know
where I save something in cookies. I guess it is at
''file.tempfile'' in
the controller, but I am not sure.
How can I avoid that error? I found something about using
session_store instead of cookie_store, but I don''t know how to do
that.
I have the following in my controller:
file = params[:file]
CSV.new(file.tempfile, {:headers => false, :col_sep =>
";"}).each
do |row|
@list << row[1]
end
end
and this in my view:
<%=form_tag ''/importcsv/csv_import'', :multipart => true
do%>
<%= file_field_tag "file" %><br/>
<%= submit_tag("Import") %>
<% end %>
Cheers,
Sebastian
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Sebastian, In order to use session store you have to do the following things, To create a migration file: rake db:sessions:create To create session table: * For development mode: rake db:migrate * For production mode: rake db:migrate RAILS_ENV=production Then un-comment the following line in config/environment.rb config.action_controller.session_store = :active_record_store restart the app.. thats it.. Saravanan K http://bit.ly/9NpP7e -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Saravanan, I am on rails 3. I don''t know if it is because of that, but I had to un-comment the line in ''config/initializers/session_store.rb'' instead of ''config/environment.rb''. And the line you send me is deprecated (my server told me), so I used this instead: Savon::Application.config.session_store :active_record_store Thank you so much it worked like a charm! Sebastian On May 20, 8:38 am, Saravanan Krishnan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Sebastian, > > In order to use session store you have to do the following things, > > To create a migration file: > rake db:sessions:create > > To create session table: > * For development mode: rake db:migrate > * For production mode: rake db:migrate RAILS_ENV=production > > Then un-comment the following line in config/environment.rb > config.action_controller.session_store = :active_record_store > > restart the app.. thats it.. > > Saravanan Khttp://bit.ly/9NpP7e > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Saravanan, I am on rails 3. I don''t know if it is because of that, but I had to un-comment the line in ''config/initializers/session_store.rb'' instead of ''config/environment.rb''. And the line you send me is deprecated (my server told me), so I used this instead: Savon::Application.config.session_store :active_record_store Thank you so much it worked like a charm! Sebastian On May 20, 8:38 am, Saravanan Krishnan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Sebastian, > > In order to use session store you have to do the following things, > > To create a migration file: > rake db:sessions:create > > To create session table: > * For development mode: rake db:migrate > * For production mode: rake db:migrate RAILS_ENV=production > > Then un-comment the following line in config/environment.rb > config.action_controller.session_store = :active_record_store > > restart the app.. thats it.. > > Saravanan Khttp://bit.ly/9NpP7e > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.