rails combining two models in form form without association -
i have 2 models primeaccount , ticket. want create ticket in primeaccount new form. trying in primeaccount controller
def create ticket = ticket.new(ticket_params) # ticket.event_id = params[:event_id] ticket.save! ............. end def ticket_params params.permit(:price, :quantity, :event_id) end def prime_account_params params.permit(:country) end
i confused how write new form accept both ticket , prime account fields.
also in url sending event params like
i want pass event_id
ticket_params
.
please tell me how create new form.
Comments
Post a Comment