Creating an object with its associated

I have a Shop and a Document model.
Shop has_many :documents and Document belongs_to :shop.
I want to create a document associated to a shop.
routes.rb has:
resources :shops do
resources :documents

In the document form I’ve set:

= f.input :shop_id, :as => :hidden if @document.new_record?

I’m using simple_form.
When I submit the form the document is created but is not associated
to the shop.
It works if I do @document = =>
params[:shop_id]) in the new action.
Why I have to specify shop_id attribute?
shop_id is a document attribute so I think that I do not specify it on
document creation.