Displaying 20 results from an estimated 10000 matches similar to: "Uncountable nouns in resource routes with Rails 3"
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 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 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''
#
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/.
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
2007 Jul 06
1
Using nouns
Luke,
I thought about what you said about nouns, but having trouble coming up
with an example of what you mean.
Would you be willing to rework my example into the words your talking about?
I''m not asking for a solution here...this is more about how to think
about the problem being solved.
Mike B.
----------------------------------------------------------------
This message was sent
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
2007 Aug 31
2
How to spec routes for a resource nested in multiples resources?
Hi,
I got the resource "Llamadas" nested in:
- Operadores
- Productos
- Centros
Here is part of my routes http://pastie.caboo.se/92767
I want to spec that the routes for Llamadas, I tried several approachs:
- route_for(:controller => "llamadas", :action => "exitosas",
:operador_id => 1).should == "/operador/1/llamadas;exitosas"
-
2006 May 12
2
Pluralization of non-noun names
People,
I have an insurance company client and for the last eleven years I have
wanted to completely redevelop their system from scratch. However, the
boss has never been interested in hiring a team to develop the new
system (partly because of the cost and partly because of some famous and
expensive development failures in the industry) and has always insisted
on incremental development of the
2007 Nov 18
0
Pseudo resource routes
I added a route mapper called facebook_resources. This allows you to
create pseudo-resource routes. Since everything is a POST in
Facebook, you can''t identify routes using HTTP verbs. Each route is
prefixed with its action, except for index.
Example:
map.facebook_resources :profiles
Will give you the following named routes:
new_profile POST /profiles/new
profiles POST
2010 Jun 18
0
i18n routes and resource names problem
Hi,
I recently tried to adopt localized resource names usage, in
particular using the http://github.com/kwi/i18n_routing plugin, but
faced a problem with HTML escaped non ANSI characters in route names.
I''ve created a ticket to track this down:
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4896
The problem was introduced with
2007 Aug 16
1
Nested REST resource routes without controller name
I am curious if the following URL pattern is appropriate to use with
REST and map.resources:
Let''s say I want to build a website with information about cars. I
decide that there will be a page to view/manage cars by model. The
route for this is easily created:
map.resources :cars
The URLs look great. But now I want to introduce the ability to
specify cars by year. I can do this by
2010 Apr 23
2
link_to with resource routes in helper file?
Hey all!
Any pointers on doing something like:
link_to "Comments", comments_path
from within a helper file just like you can do from a view?
Thanks in advance!
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To
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,
2008 Feb 25
3
customize resource routes
Hi all,
I have this application that lists videogames, which i am rewriting to
follow REST.
I need to have this url :
/games/xbox360/halo-3 ( map.connect "/
games/:platform_id/:permalink",:controller => "games",:action =>
"show" )
This is no problem with map.connect, but with map.resources i can not
make this.
map.resources :games do |game|
2006 Mar 20
2
subsetting and NAs
R-help,
I'm getting some unexpected behavior with subsetting a data frame
(aircraft flight data) that I can't sort out.
Here is a simplified version of my data frame and problem:
> flight
FlightID TailNo FlightDate HobbsTime FlightCost Date year
1 4497 6009K <NA> 2.2 330.0 <NA> NA
2 4498 6009K <NA>
2006 May 18
2
Help with Routes
I love the routes feature for RoR...until now. I''m trying to write tests
to make sure my urls are correctly mapping to the routes I expect them
to map to. This is driving me nuts because I simply can''t get any of my
tests to pass. I have thus concluded that routes must work differently
than I thought. I will try to explain my understanding of how routes
work. Via this
2006 Aug 14
1
Testing CRUD/Rest Controllers
I have a few simple controllers doing plain, simple crud in a standard way.
now it''s not very DRY to write a funtcional test for each controller, since
they are all doing the same (apart from a few variable names, but that could
be easily inflected or so).
is there a way to do this?
e.g. does inheritance work with tests, so i define a base test first,
inherit my other tests and add a few
2008 May 23
1
Fwd: Re: Model aircraft simulator Aerofly prof. deluxe
Hallo again,
the last debug massage was:
winedbg H:\\flyrun.exe
WineDbg starting on pid 0042
0x7b875fb2 start_process+0xc2 in kernel32: movl %esi,0x0(%esp)
Wine-dbg>step
Single stepping until exit from function,
which has no line number information.
Invalid address (0x7b875fb7 start_process+0xc7) for breakpoint 0, disabling it
Process of pid=0013 has terminated
Thanks for your tips and
2011 Nov 22
0
Error in gls function in loop structure
Hi, r-users
I got a problem when I try to call a *gls* function in loop structure.
The gls function seems not able to recognize the parameters that I pass
into the loop function!
(But, if I use lm function, it works.)
The code looks like this:
=================================================
gls.lm <- function(Data, iv1, dv1)
{
gls.model <- gls(Data[ , dv1] ~ Data[ , iv1], correlation =