This guy: (in the Uploader) is where you set the default image.
ruby
# Provide a default URL as a default if there hasn't been a file uploaded:defdefault_url"/images/fallback/" + [version_name, "default.png"].compact.join('_')
end
Note to all using FriendlyId for pretty URLs. In any view to create an new image be sure to change <%= link_to "New Image", new_image_path(:x_id => @x) %> to <%= link_to "New Image", new_image_path(:x_id => @x.id) %> or else you spend countless hours trying to figure out why it just won't work.
Use model.image.url
Using to_s breaks the default_url.
This guy: (in the Uploader) is where you set the default image.
Note to all using FriendlyId for pretty URLs. In any view to create an new image be sure to change
<%= link_to "New Image", new_image_path(:x_id => @x) %>
to<%= link_to "New Image", new_image_path(:x_id => @x.id) %>
or else you spend countless hours trying to figure out why it just won't work.Thanks, Ryan! This was great!