0

Forgive the title if its not exactly clear, not sure how to properly say the issue which is probably why Google isn't helping. Anyways:

Trying to use Ruby on Rails scaffold command

rails generate scaffold Product \ title:string description:text image_url:string price:decimal

Tried writing it different ways, with different inputs, etc. But it ALWAYS adds white space in the "title:string" changing to "title: string" so anywhere title:string should appear it places title: string and I get syntax error after syntax error in every file and have to manually change this. What am I or it doing wrong? I'm creating this on CentOS 7 if that makes a difference? Thanks for any help

mu is too short
  • 426,620
  • 70
  • 833
  • 800
anybodii
  • 11
  • 2
  • have you copied that part of the string from anywhere? try deleting it and typing it to see if is a bad character there – xploshioOn Sep 22 '18 at 21:42
  • 1
    Also is the backslash there for a reason? – Beartech Sep 22 '18 at 21:43
  • Does this only happen on the fields named `title`? Does it matter what data type you're trying to make `title`? Is it any field you try to make a `string`? What happens if you leave off the `:string` on title? Since I believe `string` is the default data type – Simple Lime Sep 22 '18 at 22:19
  • No I was just strictly typing it in, its an example from a text ( I'm brand new to RoR ), the backslash was in the command they used, they said to do that if you were using multiple lines ( I tried both with and without it, same result ) Though I tried what Simple Lime said, just leave title alone without string and it worked just fine. Not sure what causes that though. Doing the same command ( with title:string ) worked just fine on windows so I guess its here a linux thing or my install on the linux side is wonky. At any rate thank you for your replies and help. – anybodii Sep 23 '18 at 00:06

0 Answers0