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

http://localhost:3000/prime_accounts/new?event_id=11

i want pass event_id ticket_params.

please tell me how create new form.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -