ruby on rails - ActiveRecord::RecordNotFound -
I am trying to submit a form and receive this error: Here's the form: In the form of Post your error seen in your server console, you will see that your ultimate 'event_id' (me Seems to have a sub key of 'event_sponsorship'. Try this: and it is also possible that you will have to use this code: This will remove 'Event_ID' from your Paramon, and Event not found without id Here is the controller:
def create @ event = event.fund (param [: event_id]) @envent_sponship = eventspaceship.New (param [ : Event_sponsorship]] @ event_sponship. Spacer_id = current_yuzar.edu @ event_sponship.events_id = @ avovart response_to dot | Format | If @Event_Sponsorship Sweet Format: {@ redirect_to @event_sponsorship, notice: 'Event sponsorship was created successfully.' } Format.json {render json: @event_sponsorship, status :: created, location: @event_sponsorship} and format.html {action: "new"} format.json {render json: @ event_sponsorship.errors, status :: unprocessable_entity} end End of
create the URL should match the "event_id" where am I going?
@event = Event.find (params [: event_sponsorship] [: Event_id])
@event = Event.find (params [: event_sponsorship]] .delete (: Event_id))
EventSonsso Rship.new
Comments
Post a Comment