Displaying 20 results from an estimated 4000 matches similar to: "Re: Giving up on Rails: programmer un-happiness"
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
2012 Jul 19
20
Rails' inflections are messy
Yesterday, I opened a GitHub Issue<https://github.com/rails/rails/pull/7071> about
moving Rails inflections to an initializer. The idea wasn''t received well,
understandably, as generating a large initializer with new Rails apps is
pretty unappealing. However, the core members seemed open to the discussion
of alternatives continuing here.
For those of you not in the know,
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,
2009 Nov 17
6
after changed the tag i got the same eror
SyntaxError in Upload#index
Showing *app/views/upload/uploadfile.rhtml* where line *#10* raised:
compile error
app/views/upload/uploadfile.rhtml:10: syntax error
Extracted source (around line *#10*):
7: <% end %>
Trace of template inclusion: app/views/upload/uploadfile.rhtml
RAILS_ROOT: /home/malathi/www/upload
Application Trace <http://localhost:3000/upload#> | Framework
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
2013 Mar 26
0
Pluralization with default_locale not working (Rails 4 Beta 1)
Hi,
I am just trying to setup an application in Rails 4, Beta 1. The
application is (exclusively) in German Language and therefore also the URLs
should be German. I want to create a controller and model for an entity
called "Region"; Rails pluralizes that to "Regions", but it should be
"Regionen". What I did is: in config/application.rb uncomment this line:
2008 May 29
2
Resource routing error with the route equipment/new
I''m having an issue with resource routing after running a "ruby
script/generate scaffold equipment" command. I did not make any changes
to the equipment model/controller/views after running this.
The full command I ran (all one line) ...
ruby script/generate scaffold equipment
name:string description:text contact:text keywords:string
created_at:datetime created_by:integer
2006 Sep 28
1
[Newbie] Trying to use Inflections in a non active record class
Hi
Sorry if this is too silly to ask. I did RTFM and didn''t find anything
obvious.
I have a helper class for my controller which needs to singularize
words. I need to access methods in the
ActiveSupport/CoreExtensions/String/Inflections class. Doing a require
''ActiveSupport/CoreExtensions/String/Inflections'' fails.
How do I add this specific class to a helper class
2010 Nov 22
0
Rails 3 - Custom Inflection Not Working?
I''m using Rails (3.0.3) and have the following code in
initializers/inflections.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular(''nursery'', ''nurseries'')
end
From the console I''m getting:
"nursery".pluralize => "nurseries"
"nurseries".singularize => "nurseries"
I should be
2009 Feb 11
0
contour( ..., method='edge') incompatible with xlim & ylim
Hello,
A colleague of mine in our oceanography lab has pointed out a slightly
annoying imperfection with the contour plotting function. It appears
that the 'edge' option for the 'method' parameter doesn't work very
well (or at all?) when xlim and ylim are also set.
The following code should recreate and demonstrate the problem:
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 Jul 05
0
Association and legacy database
hi all,
I''m stuck with this:
in environment.rb I have:
Inflector.inflections do |inflect|
inflect.plural /istituto/, ''istituti''
inflect.plural /Istituto/, ''Istituti''
inflect.irregular ''Istituto'', ''Istituti''
inflect.irregular ''istituto'',
2006 Feb 23
0
inflections for different languages
Hi,
I''d like to use the rails inflections for
pluralisation/singularisation in different languages, but want to be
sure to not interfere with the pluralization of tables, field names,
etc.
However, the Inflector is a singleton... Any suggestion so that I can
define specific rules for each language, but still let rails use its
default rules?
thanks
Raph
2006 Jan 12
1
[OT] TDD, Goats and Happiness (WAS: The Guilt List)
[snip good stuff]
> After that you realize that TDD just makes you happy, so you start to
apply it to other aspects of your life.
Wait, I thought happiness had something to do with goats and feeling
guilty about it. I''m confused. Again.
But I would second Dylan''s suggestion of seeing a video of TDD in action
w/ RoR. Having never tried this, it''s difficult to
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''
#
2001 Aug 11
0
MONEY CAN'T BUY HAPPINESS!
MONEY CAN'T BUY HAPPINESS. You need FULL-CIRCLE SUCCESS: www.quickinfo247.com/2764845/FCS
2011 Feb 08
3
Model validation failing in rspec for unknown reason
Hi, i''m getting the following error when running a spec on my controller
for my Equipment model.
it "edit action should render edit template" do
get :edit, :id => Factory(:equipment)
response.should render_template(:edit)
end
Failure/Error: get :edit, :id => Factory(:equipment)
ActiveRecord::RecordInvalid:
Validation failed:
The test
2006 Feb 03
0
Re: the dreaded error Before updating scaffolding from new D
Hi Derek,
I was getting this too, with three tables, called taxa,
databases and references
I found I could add an irregular pluralisation for taxa:
Inflector.inflections do |inflect|
inflect.irregular ''taxon'', ''taxa''
end
to the environment.rb, but no amount of modification there would
allow databases and
2009 Jan 14
0
Edit method problem with a plural-named model
Hi, I recently made a model called ''news''. I realize that it''s plural
and was gonna cause some problems, but I got the routing all down fine
with:
map.resources :news, :singular => :news_article
everything works fine except the EDIT method. it gives me this error:
You have a nil object when you didn''t expect it!
The error occurred while evaluating
2006 May 18
5
Uninitialized Constant in scaffold list page
I''m new to Ruby on Rails and just trying to get it up and running. I''m
using RadRails, but I don''t think that matters for this problem.
I''ve got a very basic app with one table and I used the scaffold
generator for a table called datedgoals. The new page works fine, but
then when it switches over to the list page, I get the errors below. Any
idea how to fix