bbenezech/papermill

Multiple words model name

Closed this issue · 1 comments

Hi,
I'm reporting a bug using papermill on a multiple words model name.

I.e., if you apply papermill on a model named "BuyingLead" the image upload form crash with wrong ids. The bug is due to a composite name "Buying" + "Lead".
PaperMill generate markup with id like

, with a lot of underscores, dropping the model name.

Could u fix the bug?
Thanks
Mick

Answered by email, memo for others with similar issue :

You need to provide @object_name to form_for when the instance variable name is not @instance.class.name.camelize :
Example :
form_for :buyinglead, @buyinglead, :url => { :action => (@buyinglead.new_record? ? 'create' : 'update') } do |f|
f.image_upload :key
end