So, I'm using carrier wave to allow users to upload profile images. Now ultimately, I'd like the user to be able to click on the image and upload a new one on the fly in the profile.html.haml page.
So, I've tried the below adding a form with a put action to let the user update the image on the fly without having to go to the edit.html.haml page.
However, I'm being hit with this error:
Could not find a valid mapping for nil
Extracted source (around line #8):
<%= form_for(@user, :url => registration_path(@user), :html => { :method => :put }, :html => {:multipart => true}) do |f| %>
<%= link_to (image_tag current_user.profile_image_url(:thumb).to_s), edit_account_path(current_user)%>
<% end %>
Where did I go wrong?
Alternatively I've tried this which might be totally off:
<%= link_to (image_tag current_user.profile_image_url(:thumb).to_s), f.file_field :profile_image%>
which gave this error:
Sites/Friendiose-master/app/views/home/landing_welcome.html.erb:9: syntax error, unexpected tSYMBEG, expecting ')'
...l(:thumb).to_s), f.file_field :profile_image);@output_buffer...
Thanks in advanced.