I linked to a new-action giving a param in the URL. That param should be readable in the create-action so that i can put it in the new created object.
Specific: I'm on the show-page of a bookshelf. there is a link_to linked to the new-action of book with a paramter containing the id of the bookshelf. When creating the book i want to put the id of the bookshelf into the foreign key of the book (bookshelf_id).
How do i do this the rails way? The link_to looks like this: link_to new_book_path(:bookshelf => bookshelf). I tried reading and passing the param with @book.bookshelf = Bookshelf.find(params[:bookshelf]) in the create-action but it was an empty string.