Forums » Project Fedena - Features » Data Upload at once
is there a way to upload all student data at once from excel or any same kind of sheets? please help?
yes Mr.Madboy u can upload bulk students excel sheet for that add this code in

controller:

def bulk_upload_students
if request.post?
@parsed_file=CSV::Reader.parse(params[:dump][:file])
n=0
@parsed_file.each do |row|
c=Student.new
c.admission_no=row[0]
c.class_roll_no=row[1]
c.admission_date=row[2]
c.first_name= row[3]
if c.save
n=n+1
GC.start if n%50==0
end
end
flash[:notice]="CSV Import Successful, #{n} new records added to data base"
end
end


in View:
<% form_for :dump, :url=>{:action=>"bulk_upload_students"}, :html => { :multipart => true } do |f| %>
<table>
<tr>
<td>
<div class="filefont">
<b>Select a CSV File :</b>
</div>
</td>
<td >
<%= f.file_field :file -%>
</td>
</tr>

<tr>
<td colspan='2'>
<%= submit_tag 'Submit' -%>
</td>
</tr>
</table>
<% end -%>

in which controller and view exaclty... can you give me the files name?
and can i add all the data regarding students with bulk upload? guardians, contacts, everything related?
if u want u can write the code to keep the link of bulk upload in view/students/admission1 page aside (and creating a new page of bulk_upload_students.htrml in view/student) by clicking on link ucan move to that new page, in that page write this view code and in student controller write that controller code with that def (new page name)
bkharish. I think it is complicated process. is there any plan to include data uploads to all sections of fedena in future.??? I mean for subjects in cources, employees and students etc...
Could someone elaborate please?
I suggest commenting the code as much as possible. This would enable newbies like myself to catchup a little quickly.
I tried to insert this code, it works to the point where I select the file and send it, I get a successful message but in the database there are no records. help me please
guys can u pliz help me how do you view the fedena database!
@khezzo fedena use MYSQL data base and you can view the same in mysql console
Ask FEDENA PRO Latest version

1. Fedena Installation
2. Fedena Customization
3. Fedena Pro Plugins

truelytouchme@gmail.com

all plugin above for best price as package.quote your requirement and price.
This is usefully for me!