I have two related table in my rails application: ephemerides and ephemeris_shared_attributes.
The first one has an ephemedis_shared_attribute_id column and the seconds has columns as year, yday etc.
An ephemeris_shared_attributes is created automatically when I save an ephemeris but there is no value in it.
How can I add a form field to enter for example year and save it in the ephemeris_shared_attributes table?
Here is my current form:
= form_for @ephemeris do |f|
...
.field
= f.label :content
= f.text_area :content
.field
= f.label :locale
= f.select(:locale,['mg','fr'])
.actions
= f.submit 'Save'
You need this line in your model Ephemerides:
Then in your form:
Hope I didn’t spoil variables, these ephme…things are a little confusing 😀