Displaying 20 results from an estimated 6000 matches similar to: "Rails' inflections are messy"
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
2006 Jan 09
2
Pluralizations
Hi, I''m new to Ruby and Rails, and I''m running Ruby 1.8.4 with Rails 1.0
on Ubuntu 5.10 (breezy).
I wanted to have a model Software, with the table as software (since
''software'' is the plural too). I appreciate one can simply use something
like use_table or whatever (can''t remember the exact command) in the
Model file, but I''d much rather
2006 Jan 19
4
Using RoR pluralization rules
Hello,
RoR seems to be aware of plurals like category=>categories etc..I Want to
be able to use this in my application to relate some keywords.Is it possible
?or does RoR itself use some ruby library?
Thanks
Vivek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060119/d5660663/attachment.html
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:
2006 Apr 10
5
Inflections.rb in spanish
Hi:
I have a problem with the plural of fracancia, I got fragancium but in
spanish is fragancia.
I modified inflections in environment.rb
Inflector.inflections do |i|
i.irregular ''fragancia'', ''fragancias''
end
but is ignored.
The solution that I found was comment this inflection on inflections.rb
#inflect.singular(/([ti])a$/i,
2007 Jan 20
2
Conditional pluralize without the number
Hi.
Assume you have an array of person names. I want to generate results in
my view that look like this:
Abby is your friend
or
Abby, Bob, and Carol are your friends.
So I''d like to say:
<%= friends.to_sentence %>
<%= pluralize(friends.count, "is") %>
your <%= pluralize(friends.count, "friend") %>
But because pluralize puts in the
2006 Apr 16
5
Newbie Problems with pluralization
Hi,
I have a many to many relationship incorporating the following tables:
taxes --> taxes_tax_groups --> tax_groups
I have a model named tax with the following declaration:
has_and_belongs_to_many :tax_groups
and I have a model named tax_group with the following declaration:
has_and_belongs_to_many :taxes
I am attempting to run the following unit test:
require
2011 Apr 05
4
Rails 3.0.5 gives SQLite3::SQLException for the same code that works on 3.0.3
Hello,
I recently updated Rails to 3.0.5. The very same code that worked on
3.0.3 now gives error.
The code is:
def kategorialista
Kategoria.where(:elfogadva => TRUE).order("nev").collect {|s|
[s.nev, s.sefuri]}
end
It is in application_controller.rb with
helper_method :kategorialista
The error it gives on 3.0.5:
SQLite3::SQLException: no such table: kategoria: SELECT
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
2006 Apr 12
1
pluralization issue? (taxes/taxis)
Hi all,
Here''s an odd one. I have a "Tax" model which is related via a habtm
relationship to a "Storefront" model. In my view_store rhtml file, I
have the line :
@storefront.taxes.each do |tax|
This line returns the following error:
NameError in Admin#view_store
Showing app/views/admin/view_store.rhtml where line #52 raised:
uninitialized constant Taxis
See
2006 Jun 23
1
''Series'' Pluralization
Howdy,
I have a model I called ''content_series''. I created it and noticed that
Rails called it ''Sery'', so I added ''series'' to the uncountable thing in
the config, like this:
Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, ''\1en''
# inflect.singular /^(ox)en/i, ''\1''
#
2015 Apr 16
4
ClamAV reports a trojan
On Thu, April 16, 2015 10:09 am, Les Mikesell wrote:
> On Thu, Apr 16, 2015 at 10:01 AM, James B. Byrne <byrnejb at harte-lyne.ca>
wrote:
>> This morning I discovered this in my clamav report from one of our imap
servers:
>> /usr/share/nmap/scripts/irc-unrealircd-backdoor.nse:
>> Unix.Trojan.MSShellcode-21 FOUND
>> I have looked at this script and it appears to be
2008 Sep 20
2
NameError: uninitialized constant Inflector
I follwed the example here:
http://dekstop.de/weblog/2005/12/rails_inflector_in_ruby_scripts/
#!/usr/bin/ruby
require ''rubygems''
require ''active_support/inflector''
puts Inflector.singularize(''inflections'')
I loaded it into irb and wrote a killer script both of which worked
perfectly for weeks.
Now when I try and run the script or run
2006 Jan 09
1
Cooky Cookies
Hi All,
I have a problem with the stemming(?) in rails. I have a table cookie and a
Cookie model which I have generated a scaffold for. The problem is that
rails starts looking for a file that it calls "cooky.rb", this must be some
kind of misunderstanding between me and rails, but how do I correct it?
Other scaffolds work just fine.
/Hugo
NameError in Cookie#index
uninitialized
2007 Jan 19
9
werid error, please help
Hi all,
I updated to Rails 1.2.1. However, when I tried to access the URL
http://localhost:3000/
i get this Application Error
Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html
I removed the default index.html and route it to Account controller.
If you read the log below, it seems that the AccountController is
2011 Mar 01
11
Did rails or shoulda go insane on the inflection of 'taxes'?
I have a model ''xp_jurisdiction_taxes'' which rails (3) created correctly.
Another model ''xp_jurisdiction_states'' has many :xp_jurisdiction_taxes.
In my spec I am using a shoulda helper to test the association but get the
following error. BTW, greped the whole project just in case and the string
''taxi'' exists nowhere.
1)
2010 Mar 18
3
rake db:migrate -> uninitialized constant
Hi--
I''m trying to do a first migration (2.3.5). I generated a model
"Video", but when I try to migrate I get "uninitialized constant
Videos". Why is it trying to find a plural class name?
Here''s more complete output:
trans@logisys:models$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
**
2008 Mar 06
1
Was "Inflector" moved in Rails 2.0?
Trying to place the following code in my "environment.rb" file is
throwing an "uninitialized constant Inflector (NameError)".
Did they move where these types of customized rules were supposed to be
declared?
******CODE******
Inflector.inflections do |inflect|
inflect.uncountable("media")
end
--
Posted via http://www.ruby-forum.com/.
2006 May 22
3
Syntax error when running dispatch.cgi
Hi,
when I execute dispatch.cgi at the command line, I get the following
error message:
[cg@cg rails]$ ./public/dispatch.cgi
./public/dispatch.cgi:3:in `require'':
./public/../config/environment.rb:8: syntax error, unexpected ''<''
(SyntaxError)
<%= ''# '' if freeze %>RAILS_GEM_VERSION = ''<%= Rails::VERSION::STRING %>''
2006 Jun 13
6
tax a reserved word?
Is tax a reserved word or am I sleep deprived??
I''m working on a shopping cart and have a table called sales_taxes (at
first i named it taxes).
I get the following error when i load the controller:
uninitialized constant SalesTaxis
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace