Skip to content

Instantly share code, notes, and snippets.

@superlou
Created January 5, 2014 02:18
Show Gist options
  • Save superlou/8263455 to your computer and use it in GitHub Desktop.
Save superlou/8263455 to your computer and use it in GitHub Desktop.
undefined method `image_url' for #<ImagesController:0x000000025ff6c0> on line 10 Solved: needed "resources images" in routes.
class ImagesController < ApplicationController
respond_to :json
def create
@image = Image.new
@image.user_id = params[:user_id]
@image.upload = params[:upload]
@image.save!
puts @image.upload.url
respond_with @image
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment