J
J
Japanmama2016-02-22 17:30:51
Ruby on Rails
Japanmama, 2016-02-22 17:30:51

Rails 4. Undefined_method 'image_geometry' error in paperclip?

Good afternoon,
I came across a situation where it is necessary to transfer a photo to the form for cropping, but it gives an error: undefined_method 'image_geometry'
There are two tables company and company_services - the relationship between them has_many - belongs_to.
Controller:

def create
@company_service = CompanyService.new(company_service_params)
if @company_service.save
if params[:company_service][:image].blank?
redirect_to current_company
else
redirect_to crop_company_service_path(@company_service)
end
end
end

The form:

<%= form_for :company_services do |f| %>
<%= f.cropbox :image, :width => 400 %>
<%= f.crop_preview :image, :width => 130 %>
<%= f.submit 'Save' %>
<% end %>

Roots:
resources :company_services do
member do
get 'crop', as: :crop
end
end
Thanks in advance

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question