0

Newbie here, and trying to use CarrierWave to upload an image. However when I get to localhost this error message keeps popping up

C:/Sites/redemo/app/models/listing.rb:2: syntax error, unexpected tCONSTANT, expecting keyword_end

# GET /listings.json
 def index
  @listing =Listing.all
 end

Rails.root: C:/Sites/redemo

Application Trace | Framework Trace | Full Trace app/controllers/listings_controller.rb:7:in `index'

However, when I check listing.rb this is what I see

class Listings < ActiveRecord::Base
    mount_uploader :image ImageUpLoader
end

Am I missing something obvious here? I've tried looking through similar posts to no avail. Please help, thank you!

1 Answer 1

1

You're missing a comma in your mount_uploader method arguments:

mount_uploader :image, ImageUpLoader

Basically, mount_uploader is a method like any other and it's receiving 2 arguments so they need to be delimited by a comma.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.