Google Groups Home
Help | Sign in
Reserved resource names?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Sean Schofield  
View profile
 More options Apr 20, 3:14 pm
From: Sean Schofield <sean.schofi...@gmail.com>
Date: Sun, 20 Apr 2008 12:14:05 -0700 (PDT)
Local: Sun, Apr 20 2008 3:14 pm
Subject: Reserved resource names?
I tried to create a resource using the following

 script/generate scaffold_resource client

I got the following message:

  The name 'Client' is reserved by Ruby on Rails.
  Please choose an alternative and run this generator again.

I did a bit of searching and I couldn't find anything about the word
"client" being reserved in Rails.  I've also already setup my data
model (prior to installing the resources_controller) and I was able to
run my migrations just fine with this name.

Is this a restriction being introduced by r_c?

TIA,

Sean


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Golick  
View profile
 More options Apr 20, 4:12 pm
From: "James Golick" <jamesgol...@gmail.com>
Date: Sun, 20 Apr 2008 16:12:19 -0400
Local: Sun, Apr 20 2008 4:12 pm
Subject: Re: Reserved resource names?

If rails finds that constant present anywhere in your app, it assumes that
it's reserved. It's a bad error message, but that's what's happening.

J.

On Sun, Apr 20, 2008 at 3:14 PM, Sean Schofield <sean.schofi...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sean Schofield  
View profile
 More options Apr 20, 4:32 pm
From: "Sean Schofield" <sean.schofi...@gmail.com>
Date: Sun, 20 Apr 2008 16:32:39 -0400
Local: Sun, Apr 20 2008 4:32 pm
Subject: Re: Reserved resource names?
So are you saying the conflict is with my own client.rb?  There are no
such problems with the other pre-existing models that I have.

Sean


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Golick  
View profile
 More options Apr 20, 4:40 pm
From: "James Golick" <jamesgol...@gmail.com>
Date: Sun, 20 Apr 2008 16:40:26 -0400
Local: Sun, Apr 20 2008 4:40 pm
Subject: Re: Reserved resource names?

Really? Weird.
That was my assumption, because I've run in to the same problem before.
Other than that, I've got no idea.

It has nothing to do with r_c's generator, which is really just a modified
version of the scaffold_resource generator.

On Sun, Apr 20, 2008 at 4:32 PM, Sean Schofield <sean.schofi...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sean Schofield  
View profile
 More options Apr 22, 3:02 pm
From: Sean Schofield <sean.schofi...@gmail.com>
Date: Tue, 22 Apr 2008 12:02:54 -0700 (PDT)
Local: Tues, Apr 22 2008 3:02 pm
Subject: Re: Reserved resource names?
James is right that this is something that Rails is complaining
about.  I never quite figured out why Rails thought that I had these
constants defined.  I ran into another problem trying to create a
vendor resource.  I believe the problem with vendor may be that there
are other constants defined in the vendor folder.

Since I had already created my models and I just wanted to stub out
the r_c stuff I added the following hack to the
scaffold_resource_generator.rb that comes with r_c

module Rails
  module Generator
    module Commands
      class Create
        def raise_class_collision(class_name)
          # Do Nothing
        end
      end
    end
  end
end

Just in case anyone else is running into that issue.

Sean


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google