I am using Rails 0.13.1 and typing: script/generate scaffold Student I am getting: The name ''Student'' is reserved by Ruby on Rails. Please choose an alternative and run this generator again. Suggestions: Sense 1 student, pupil, educatee -- (a learner who is enrolled in an educational institution) => enrollee -- (a person who enrolls in (or is enrolled in) a class or course of study) Sense 2 scholar, scholarly person, student -- (a learned person (especially in the humanities); someone who by long study has gained mastery in one or more disciplines) => intellectual, intellect -- (a person who uses the mind creatively) --- What problem rails have with ''student'' exactly? I don''t like any of those suggestions, is there a workaround? Thanks in advance
Hi Moshe, For me it worked well. Also I have seen some samples using ''Student'' class in Rails API: http://api.rubyonrails.com/classes/ActiveRecord/Transactions/ClassMethods.html Eszter Moshe wrote:> I am using Rails 0.13.1 and typing: > script/generate scaffold Student > > I am getting: > The name ''Student'' is reserved by Ruby on Rails. > Please choose an alternative and run this generator again. > > Suggestions: > > Sense 1 > student, pupil, educatee -- (a learner who is enrolled in an educational > institution) > => enrollee -- (a person who enrolls in (or is enrolled in) a class or > course of study) > > > Sense 2 > scholar, scholarly person, student -- (a learned person (especially in the > humanities); someone who by long study has gained mastery in one or more > disciplines) > => intellectual, intellect -- (a person who uses the mind creatively) > > --- > > What problem rails have with ''student'' exactly? I don''t like any of those > suggestions, is there a workaround? > > Thanks in advance > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Primalgrasp LLC http://primalgrasp.com
On Tuesday 06 September 2005 21:20, Moshe wrote:> I am using Rails 0.13.1 and typing: > script/generate scaffold Student[snip]> What problem rails have with ''student'' exactly? I don''t like any of > those suggestions, is there a workaround?IIRC, you get this error message when you try to generate a scaffold and a constant with the same name is already defined (in Ruby classes are bound to constants). This can be the case, for instance, if you have loaded/required your Student class already in your environment.rb. Michael -- Michael Schuerig All good people read good books mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org Now your conscience is clear http://www.schuerig.de/michael/ --Tanita Tikaram, Twist In My Sobriety
It works fine for me too. Are you sure it is not a practical joke or something? ;-) Gennady. Biro Eszter wrote:> Hi Moshe, > > For me it worked well. Also I have seen some samples using ''Student'' > class in Rails API: > http://api.rubyonrails.com/classes/ActiveRecord/Transactions/ClassMethods.html > > Eszter > > Moshe wrote: > >>I am using Rails 0.13.1 and typing: >>script/generate scaffold Student >> >>I am getting: >> The name ''Student'' is reserved by Ruby on Rails. >> Please choose an alternative and run this generator again. >> >> Suggestions: >> >>Sense 1 >>student, pupil, educatee -- (a learner who is enrolled in an educational >>institution) >> => enrollee -- (a person who enrolls in (or is enrolled in) a class or >>course of study) >> >> >>Sense 2 >>scholar, scholarly person, student -- (a learned person (especially in the >>humanities); someone who by long study has gained mastery in one or more >>disciplines) >> => intellectual, intellect -- (a person who uses the mind creatively) >> >>--- >> >>What problem rails have with ''student'' exactly? I don''t like any of those >>suggestions, is there a workaround? >> >>Thanks in advance >> >>_______________________________________________ >>Rails mailing list >>Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>http://lists.rubyonrails.org/mailman/listinfo/rails >> > > >
Michael Schuerig <michael@...> writes:> > On Tuesday 06 September 2005 21:20, Moshe wrote: > > I am using Rails 0.13.1 and typing: > > script/generate scaffold Student > [snip] > > > What problem rails have with ''student'' exactly? I don''t like any of > > those suggestions, is there a workaround? > > IIRC, you get this error message when you try to generate a scaffold and > a constant with the same name is already defined (in Ruby classes are > bound to constants). This can be the case, for instance, if you have > loaded/required your Student class already in your environment.rb. > > Michael >Nope, I am just trying ruby on rails for the first time, and I am trying to re-write existing PHP application I have. I am starting from scratch, writing: ''rails <projectname>'' then right after editing database.yml: script/generate scaffold Student students... I can generate the model file: -- script/generate model Student exists app/models/ exists test/unit/ exists test/fixtures/ overwrite app/models/student.rb? [Ynaq] force app/models/student.rb overwrite test/unit/student_test.rb? [Ynaq] force test/unit/student_test.rb overwrite test/fixtures/students.yml? [Ynaq] force test/fixtures/students.yml -- I can generate ''students'' controller: -- script/generate controller students exists app/controllers/ exists app/helpers/ exists app/views/students exists test/functional/ create app/controllers/students_controller.rb create test/functional/students_controller_test.rb create app/helpers/students_helper.rb -- But when trying to get a scaffold: script/generate scaffold Student students exists app/controllers/ exists app/helpers/ exists app/views/students exists test/functional/ overwrite app/views/students/_form.rhtml? [Ynaq] force app/views/students/_form.rhtml dependency model The name ''Student'' is reserved by Ruby on Rails. Please choose an alternative and run this generator again. Suggestions: Sense 1 student, pupil, educatee -- (a learner who is enrolled in an educational institution) => enrollee -- (a person who enrolls in (or is enrolled in) a class or course of study) Sense 2 scholar, scholarly person, student -- (a learned person (especially in the humanities); someone who by long study has gained mastery in one or more disciplines) => intellectual, intellect -- (a person who uses the mind creatively)
Gennady Bystritsky <bystr@...> writes:> Are you sure it is not a practical jokeNope, not a joke unfortunately
In article <loom.20050907T080512-98-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>, rails- aMprgpNHt/VeoWH0uzbU5w-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> > > What problem rails have with ''student'' exactly? I don''t like any of > > > those suggestions, is there a workaround? > > > > IIRC, you get this error message when you try to generate a scaffold and > > a constant with the same name is already defined (in Ruby classes are > > bound to constants). This can be the case, for instance, if you have > > loaded/required your Student class already in your environment.rb. > > > > Michael > > > > Nope, I am just trying ruby on rails for the first time, and I am trying to > re-write existing PHP application I have.Just took a look at the code - it''s definitely only called when there is another class with the same name. Do you have anything else named "student"? I''m too new to know what SHOULD conflict, but maybe the database name, since that''s in ActiveRecord too? Or both singular and plural tables? If you do, try changing them one by one to see what''s conflicting... -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler
> > Do you have anything else named "student"? I''m too new to know what > SHOULD conflict, but maybe the database name, since that''s in > ActiveRecord too? Or both singular and plural tables? If you do, try > changing them one by one to see what''s conflicting... >Thanks for your reply. This is the first model I am creating for this project. I only have single table called ''students'' in the database...
In article <loom.20050907T150227-85-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>, rails- aMprgpNHt/VeoWH0uzbU5w-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> I only have single table called ''students'' in the database...What''s the database called? Could you post your database.yml and your CREATE TABLE statement? -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler
> What''s the database called? Could you post your database.yml and your > CREATE TABLE statement? >database is called ''pniot_development'', ''pniot'' is a Hebrew word. --- database.yml: --- development: adapter: mysql database: pniot_development host: localhost username: root password: test: adapter: mysql database: pniot_test host: localhost username: root password: production: adapter: mysql database: pniot_production host: localhost username: root password: --- the create table: --- CREATE TABLE `students` ( `id` int(11) NOT NULL auto_increment, `fname` varchar(50) NOT NULL default '''', `lname` varchar(50) NOT NULL default '''', `email` varchar(50) NOT NULL default '''', `phone` varchar(20) NOT NULL default '''', `pelephone` varchar(50) NOT NULL default '''', `fax` varchar(50) NOT NULL default '''', PRIMARY KEY (`id`) ) TYPE=MyISAM; Thanks in advance.
Jay Levitt <jay-news@...> writes:> > In article <loom.20050907T150227-85@...>, rails- > aMprgpNHt/VeoWH0uzbU5w@... says... > > I only have single table called ''students'' in the database... > > What''s the database called? Could you post your database.yml and your > CREATE TABLE statement? >I''ve tried some more things and they all reserved **** Try #1: **** script/generate scaffold Thread exists app/controllers/ exists app/helpers/ exists app/views/threads exists test/functional/ must be called with a block **** Try #2: **** ./script/generate scaffold Member exists app/controllers/ exists app/helpers/ exists app/views/members exists test/functional/ overwrite app/views/members/_form.rhtml? [Ynaq] force app/views/members/_form.rhtml dependency model The name ''Member'' is reserved by Ruby on Rails. Please choose an alternative and run this generator again. **** Try #3: **** ./script/generate scaffold CreditCard exists app/controllers/ exists app/helpers/ exists app/views/credit_cards exists test/functional/ create app/views/credit_cards/_form.rhtml dependency model The name ''CreditCard'' is reserved by Ruby on Rails. Please choose an alternative and run this generator again. Suggestions: --- So the question now becomes, what''s wrong with rails? strange thing is, it''s also happening with rails on the one-click-installer on another machine.
I installed rails on another computer (running Windows this time) and creating those scaffolds worked. I''ll have to see what''s wrong with rails on the Ubuntu box, if anyone got ideas, let me know. Thanks
On Wed, Sep 07, 2005, Moshe wrote:> Michael Schuerig <michael@...> writes: > > > > > On Tuesday 06 September 2005 21:20, Moshe wrote: > > > I am using Rails 0.13.1 and typing: > > > script/generate scaffold Student > > [snip] > > > > > What problem rails have with ''student'' exactly? I don''t like any of > > > those suggestions, is there a workaround? > > > > IIRC, you get this error message when you try to generate a scaffold and > > a constant with the same name is already defined (in Ruby classes are > > bound to constants). This can be the case, for instance, if you have > > loaded/required your Student class already in your environment.rb. > > > > Michael > > > > Nope, I am just trying ruby on rails for the first time, and I am trying to > re-write existing PHP application I have. > > I am starting from scratch, writing: > ''rails <projectname>'' > > then right after editing database.yml: > script/generate scaffold Student students... > > I can generate the model file:snip> I can generate ''students'' controller:snip> But when trying to get a scaffold:snip ...I think Michael was right. This is happening because you already generated the model and controller. Once you''ve done that, it''s treated as a reserved word because they already exist. The scaffold generator creates the models, controllers, and views for you. Try running it alone instead of generating the controllers and models first. Ben
Is this a good idea for certain gui apps? I am writing a debugger, so need to scroll code, single-step, highlight, and display variables. The above seems like a piece of cake for Rails, except on scrolls, mvc model returns to server, classicly. Any opinions on using Ajax to scroll text, etc? There is a huge incentive to use Rails as a general GUI: Only one learning curve to learn. Any opinions? -John B
How are you thinking of using Rails? It''s a web framework. I guess you might try something with Ajax calls and such, but it seems like you would have extremely overcomplicated code. You''re not interacting with a database really, so active record wouldn''t help you. Did you have a specific approach in mind? I''m curious to see what you are thinking? Josh On 9/8/05, speechexpert <speechexpert-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org> wrote:> Is this a good idea for certain gui apps? > I am writing a debugger, so need to scroll code, single-step, highlight, and > display variables. > > The above seems like a piece of cake for Rails, except on scrolls, mvc model > returns to server, classicly. > Any opinions on using Ajax to scroll text, etc? > > There is a huge incentive to use Rails as a general GUI: Only one learning > curve to learn. > > Any opinions? > > -John B > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Well, a debugger is client-server in the sense that the control comes from the person doing the debugging. The model can be the debugger code itself. The coordination of code view and model is very naturally done by the controller. Look at it this way: The MVC architecture plus GUI (CSS) is very strongly implemented in Rails. Not to mention the generator, which as you know can be modified. Its definitely X-platform. Finally, the know-how does double-duty as web and GUI together. Its this last factor that''s a real clincher for me - at least makes me try to see if Rails can do double-duty. Ah well, on to learn FXRuby... JB ----- Original Message ----- From: "Josh Charles" <josh.charles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> Sent: Thursday, September 08, 2005 2:40 PM Subject: Re: [Rails] Rails as a Windows GUI? How are you thinking of using Rails? It''s a web framework. I guess you might try something with Ajax calls and such, but it seems like you would have extremely overcomplicated code. You''re not interacting with a database really, so active record wouldn''t help you. Did you have a specific approach in mind? I''m curious to see what you are thinking? Josh On 9/8/05, speechexpert <speechexpert-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org> wrote:> Is this a good idea for certain gui apps? > I am writing a debugger, so need to scroll code, single-step, highlight, > and > display variables. > > The above seems like a piece of cake for Rails, except on scrolls, mvc > model > returns to server, classicly. > Any opinions on using Ajax to scroll text, etc? > > There is a huge incentive to use Rails as a general GUI: Only one learning > curve to learn. > > Any opinions? > > -John B > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails