If i have two models like Question and Answer. Question has three
columns
like question_id, question_type, question_text and Answer has three
values answer_id,
question_id, answer_text.
Here, I am using the hidden field to find the question_type. I tried the
map method,
but that doesn’t work. So Somebody help me to get the question_type
value
by the selection of thatquestion_id.
If i have two models like Question and Answer. Question has three columns
like question_id, question_type, question_text and Answer has three values
answer_id, question_id, answer_text.
Question should generally not have a question_id field, it should just
have the default id field. Unless that is you have some unusual
requirements.
value by the selection of thatquestion_id.
You have not shown us the relationship between the models (has_many,
belongs_to or whatever). That information is critical to answering
the question.
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.