Rails 4/ ajax - NoMethodError - undefined method `id' for nil:NilClass - Passing variable to js modal
问题 I have a pretty simple Ruby On Rails app with bootstrap 3 for the front end: I have Deals, and each Deal has_many Opportunities. On each Deal page (url of deal page is for example myapp.com/id=1), I want to have a textual link that says "view deal's opportunities" and when clicked, it trigger when clicked the appearance of content inside a Bootstrap modal. I'm getting all mixed up because on this Deal Page, I use Deal's controller action called "showcase". BUT to generate the modal via ajax