This project is archived and is in readonly mode.
Suggestion: Change to create Rails 3.0 apps by `rails init app-name`
-
Harri Kauhanen
+1
Excellent suggestion!
There's fix #8994 to prevent creating projects with name 's', 'db' and so on with Rails 3, but that one is a bit ugly and does not really solve the problem. If you use both Rails 2.3 and Rails 3, you will keep creating those 's' projects for a long time (transition from Rails 2.3 to Rails 3 will certainly take some time). Anyone using rvm (Ruby version manager) knows what I am talking about. Rails 2.3.6 should also include a fix that would warn if you try to create project under name 'init'.
'rails init' also feels much more natural than the current default behavior.
-
Harri Kauhanen
The fix number I should have written is #4602 Make 's' reserved word in 'rails ...' command, not 8994.
-
Neeraj Singh
+1 rails init <project_name> feels better.
-
vesan
+1
This is change from how things have worked previously but IMHO change for the better.
-
Rohit Arondekar
+1 for the change, I've been hit by this same problem too and it would be nice to do rails init app-name. Can somebody start working on a patch?
-
Jeff Kreeftmeijer
+1
Since the
railscommand handles everything (like generating scaffolds, starting the server and console etc.) in Rails 3,rails appnameto generate an app doesn't feel right anymore. I thinkrails init appnameis much more like the rest of therailscommand and it'll keep me from having to remove directories like "s" or "console". Great suggestion! :) -
Justin Baker
+1
This irritates me so much when I do it, everyone seems to do it too.
-
Justin Baker
I have a quick fix that I posted as a gist on github, obviously this probably needs more to see if you're already in a rails app directory, but if you're sick of the accidental app creation then it should work.
-
Justin Baker
And here's a patch, sorry there's so many comments
-
Rohit Arondekar
- Assigned user set to Mikel Lindsaar
-
Mikel Lindsaar
- Milestone cleared.
OK, thanks everyone, I took Juston's patch and have gone over it with DHH. We are going to make a couple of changes to your patch and then merge into rails/master.
-
Rohit Arondekar
That's awesome news Mikel! Cheers Pyry for bringing it up and Justin for the patch. :)
-
Justin Baker
Documentation/Guides/Tutorials will have to be updated though, but the help message shouldn't be too hard for a user to follow if they run rails testapp after following a guide to create an application before this.
-
Ryan Bigg
Any further work on this?
-
Mikel Lindsaar
Yup, almost done :)
-
Justin Baker
Awesome, been waiting to see it in rails/master!
-
Elise Huard
+1 great idea.
-
Ryan Bigg
Thanks Mikel! Just installing now and will let you know if it goes or blows.
-
Ryan Bigg
The usage of the "rails" command still says
rails APP_PATH [options]Maybe I'm being picky?
-
Mikel Lindsaar
Really? Where (or when)? I'll fix. I thought I found all of those...
-
Mikel Lindsaar
Thanks Ryan, good spotting, fixed in this commit
-
Rohit Arondekar
Awesome work! Can't wait to see this in Rails master :)
-
Ryan Bigg
- State changed from open to committed
-
Uģis Ozols
After this addition to rails is there a way to generate app with older rails version? In 3.0.0.beta3 I could use rails 2.3.8 app_name
-
Ryan Bigg
You can still do rails _2.3.8_ app_name to generate an app for 2.3.8.
-
Uģis Ozols
Oh I'm sorry... it's working perfectly. Messed up on my end :)
