1

I have to pass 2 objects to show so I tried to put this

respond_with(@ticketnfr, @ticket)

but it goes to ticket controller view,

when I tried with only one object

respond_with(@ticketnfr)

it goes correctly to ticketnfr/show, but I miss the ticket params,

I also tried to put the location

respond_with(@ticketnfr, @ticket. :location => ticketnfr_path)

but it goes to the index instead of show

how to pass both of the objects but still going to the ticketnfr/show?

TiSer
  • 775
  • 3
  • 11
  • 30
alfitra
  • 27
  • 7

2 Answers2

0

Try this one:

@response = {:ticket => @ticket, :ticketnfr => @ticketnfr}
respond_with(@response)
TiSer
  • 775
  • 3
  • 11
  • 30
0

i have create the respond_with like this

respond_with(@ticketnfr, :location => ticketnfr_url(:id => @ticketnfr.id, :ticket_id => @ticket.id))

Thank You

alfitra
  • 27
  • 7