Displaying 20 results from an estimated 10000 matches similar to: "Overriding Model Name"
2007 Dec 18
2
Active Resource and non default model names
I have a model (accessed restfully) named TranscoderQueue, it''s name
is overridden to ''TransocderQueue'' so it is accessed as ''/
transocder_queue'' as opposed to ''/transocder_qeueus''.
class TranscoderQueue < ActiveRecord::Base
belongs_to :campaign, :class_name => "Campaign", :foreign_key =>
"campaign_id"
2006 Aug 15
6
try creating a table for your model
Railers:
Greetings from the low end of the learning curve. I have installed all
the prerequisites on Win32, including a lite MySQL database with a
table in it called Inventory.
Then I run this command line...
ruby script/generate ajax_scaffold Inventory
...and I get this error message:
error Before updating scaffolding from new DB schema, try creating
a table for your model
2006 Aug 01
1
Legacy Pluralized Table Names
I am connecting to a legacy DB that has some names plural and some not.
I have configured:
ActiveRecord::Base.pluralize_table_names = false
now when i make a table that has an s on the end, it truncates the s.
example:
Table name: foo_bars
Rails command: ruby script/generate FooBars
Response (localhost:3000/FooBars): uninitialized constant FooBar
It works fine with non-pluralized
2005 Aug 08
68
Pluralized Controller Names?
If I do:
script/generate controller Photo
I get a controller named photo_controller. OTOH, if I do:
script/generate scaffold Photo
I get a controller named photos_controller. (Note that the controller
name is pluralized).
I realize that I''m specifying the controller name explicitly in the
first case, but it seems
odd to me that the scaffold command generates a pluralized
2010 Jan 26
6
Subclassing ActiveRecord::Base
First of all, sorry for the crossposting, but I put this into the Ruby
Forum first of all, but was pointed to this as a more appropriate
location.
I''m using ActiveRecord and ActiveSupport in a non-rails environment
to connect to multiple databases, and I''ve found the following (single
database) to cause me an error. Note that params is my database settings
and omitted for
2010 Jan 16
2
La.svd of a symmetric matrix
Dear R list users,
the singluar value decomposition of a symmetric matrix M is UDV^(T), where U = V.
La.svd(M) gives as output three elements: the diagonal of D and the two orthogonal matrices u and vt (which is already the transpose of v).
I noticed that the transpose of vt is not exactly u. Why is that?
thank you for your attention and your help
Stefano
AVVISO IMPORTANTE: Questo messaggio di
2006 Jul 21
4
weird table pluralization problem
When I created a new project and a "equipment" model for an unknown
reason to me rails tried to query the table "equipment" and not
"equipments", does someone know why it did that ?
So I added
set_table_name "equipments"
in the model class and it now works but I don''t really understand why it
is required in the first place...
--
Posted via
2017 Oct 25
1
[OT] Bash help
Leroy Tennison wrote:
> No kidding, but in that "other OS" the answer to the question "how can I
> create that report" is usually "You can't unless you spend money for a
> third-party application".
>
"Other", singluar? Did you mean WinDoze, or on an IBM mainframe, or...?
mark "been around the block"
> ----- Original
2009 Sep 14
5
Expecting field value and getting record
The following short console session illustrates the problem:
Loading development environment (Rails 2.3.2)
>> topic=BlogTopic.find(4)
=> #<BlogTopic id: 4, parent: 2, topic: "Topic Four", created_at:
"2009-07-13 21:31:22", updated_at: "2009-09-14 00:37:29">
>> topic.inspect
=> "#<BlogTopic id: 4, parent: 2, topic: \"Topic
2012 Dec 13
23
make rails connect with database
i''m newbie in rails. i have problem with how to connect rails with
database. before i can connect it with command
"rake db:create" to create database.
and "rake db:migrate" to migrate schema to database.
but, i want to connect rails with database that i have before, not
create it via rails. can you help me?
--
Posted via http://www.ruby-forum.com/.
--
You received
2006 Jul 26
5
RoR data models ( extreme newbie question)
Sorry for asking this but I am keen to get on and build an app based on
RoR and have had a look around at FAQa and the like with no immediate
sucess.
What I am looking for is an explainantion of the rules/requirements for
table/index/coulumn names with RoR. RoR appears to have a set of
expected naming conventions which it would appear you can over ride but
it would seems a hell of a lot
2006 Mar 27
1
Naming Convemtion for Model????
Hi,
In My database there is a table called "categories". Now what name
should I specify for my model as per ruby naming convention? Is it
"Category"???
Also is it possible to keep database table name singular instead of
plural?
Please tell me.
Thanx in advance.
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a
terrible time getting the models set up correctly. I have an order
table that has a primary field named order_number. I have a name table
with a primary of item_number. These two tables are liked by the
item_number and the order_number, but not as you might think. If the
order_number is 2500, then each entry in
2006 May 11
2
Making my site multi-lingual
Hi,
I''m wondering how I should go about making my website multi-lingual.
Basically, there will be different content for the different
languages, and that''s not really a problem... all I need to do is give
each content entry in the database a language_id. But the problem is
with the non-content text, eg, "In order to access this area, you must
be logged in",
2006 May 22
3
rails naming convention for model: community
Hello,
How does Rails deal with the pluralization of community. I have "community"
as my model name. Will Rails automatically look for a table name
"communities" or do I have to name the table "communitys"?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2009 Jul 19
9
Equipment_URL Failed to Generate (new_equipment_path)
I''m trying to use new_equipment_path, which creates the appropriate
link. But, when trying to evaluate "equipment/new" I get the error
below. I''ve included my routes (rake route). Equipment is one of those
words that pluralizes to "equipment", so the singular is right (from
what I know from this forum.
Any help would be appreciated.
Error:
equipment_url
2008 Feb 26
1
creating models from existing db tables
How do I automatically create model classes from an existing db
schema? this is in RoR 2.0
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2006 Oct 25
12
NameError, uninitialized constant States
I''m completely new to Ruby and Rails and could use some help resolving
an issue. I have a list method that is supposed to show the titles and
states(status) of requests, but I get an error from this piece of code:
<td><%= change.states.state %></td>
The error is:
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
2005 Dec 22
11
rforum engine
Here''s a question for those well-versed in rforum or engines -- or
both, ideally :) I''ve spent some time today turning RForum into an
engine, using rails 1.0, engines trunk, and rforum 0.1 (as rforum
trunk didn''t appear to work out of the box).
My rforum engine works, but only when I do two things that I found by
trial and error:
1) All rforum controllers subclass
2006 Jun 07
2
script/generate scaffold pluralizes class names
Hi everyone,
I''m a rails & ruby nuby, and this is my first post to the list.
Here''s my environment in case it helps diagnose my problem:
Ruby version
1.8.4 (powerpc-darwin8.6.0)
RubyGems version
0.8.11
Rails version
1.1.2
Active Record version
1.14.2
Action Pack version
1.12.1
Action Web Service version
1.1.2
Action Mailer version
1.2.1
Active Support version
1.3.1
I did