top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Rails: How can i add multiple records to a single table, through single form

+1 vote
286 views

I have just started with rails. I am making a attendance web app. I want to insert student attendance into attendances table and unable to do it as the form just inserts only last entry of the form. Student table and Attendances table have associations (has_many,belongs_to).

Please let me know how the form should be and controller API should look like.

posted Jun 22, 2015 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
0 votes

I have 4 tables from the first table, I took all data from the two columns and displayed it in the view. For each data, I have two text fields and the user is supposed to fill those data. Having filled data into the text field, how can I insert all the records into the second table using one form only?

0 votes

I have deployed a ruby on rails app on two instances of production server, now there are two separate log file are being created for different instances. My question is how I can make a single log file for both the instances?

+1 vote

I have a Rails application with a default time zone of UTC. This works fine for almost everything. Now I have a situation where I would like to present the values in a datetime_select offset by a specific time zone. As far as I know, this helper does not have an option to specify the time zone that is used when persisting this data. When the form is submitted, it only sends the year, month, day, hour, and minute fields. ActiveRecord is responsible for converting these values into the time zone configured for the application. In this case, I want to change the time zone for only these fields so that it is localized to the user (but still store the correct UTC time). How can I make this change?

+2 votes

I need an Idea of how to put a google map in my application, I have field and I want to fill it with address and I want a map in the next line showing the address that I entered in my field......

+1 vote

EXAMPLE
mail(:to => user.email, :subject => "Hello World!", :from => "abc@gmail.com")

...