CarrierWave file does not show up
So when I get the image upload, the show page confirms that the registration was successful, but does not show the image. I get:
Charle was successfully updated.
Title: yes
Name: john doe
?1310250102
Edit | Back
This is the error I get in terminal when running the server
Started GET "/images/?1310250102" for 127.0.0.1 at Tue Jul 12 11:42:15 -0400 2011
ActionController::RoutingError (No route matches "/images"):
Rendered /usr/local/lib/ruby/gems/1.8/gems/actionpack-开发者_运维技巧3.0.7/lib/action_dispatch/middleware /templates/rescues/routing_error.erb within rescues/layout (2.1ms)
This is what my routes file looks like:
Evergreen::Application.routes.draw do
resources :charles
I had the same problem and it seemed to be caused by a piece of code that I picked up from another answer and added to my code with out understanding it:
def image=(val)
if !val.is_a?(String) && valid?
image_will_change!
super
end
end
Do you also happen to be using this code? I removed it completely and that solved the problem!
精彩评论